Question & Answer
Question
How to set a property with a choicelist to a null value using the P8 Content Engine Java API
Answer
Code sample using the P8 Content Engine Java API to set a property that uses a choicelist back to null.
oDoc = (Document) oStore.getObject(BaseObject.TYPE_DOCUMENT,"/myChoice");
System.out.println(oDoc.getId().toString());
String name = oDoc.getPropertyStringValue("myChoiceListProp");
String newName = null;
com.filenet.wcm.api.Properties props = ObjectFactory.getProperties();
Property nameProp = ObjectFactory.getProperty("myChoiceListProp");
nameProp.setValue(newName);
props.add(nameProp);
oDoc.setProperties(props);
System.out.println("Renamed '" + name + "' to '" + newName + "'");
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21394046