Read Page 3 values when saving a document.
We are trying to read text field and List values from a document object using the below snippet.
We are able to retrieve the value of the text field and the list from page 2 but the Page 3 attributes aren’t readable.. on debugging we found the values are not retrieved in the eventInfo object.. what is a recommended way to read the page 3 fields on saving the document?
Code snippet:
/**
* @param objClass
* @param eventInfo
* @param str
* @return
* @throws APIException
*/
static String getSingleListValue(IAgileClass objClass, IUpdateEventInfo eventInfo, String str) {
String strListVal = “”;
try {
strListVal = (((IAgileList) eventInfo.getValue(objClass.getAttribute(str).getId())).getSelection()[0].getValue()).toString();
} catch (Exception e) {
logger.log(Level.SEVERE, “Could not get value of <” + str + “>.”, e.getMessage());
}
return strListVal;
}
/**
* @param objClass
* @param eventInfo
* @param str
* @return
* @throws APIException
*/
static String getStringValue(IAgileClass objClass, IUpdateEventInfo eventInfo, String str) {
String strVal = “”;
try {
strVal = eventInfo.getValue(objClass.getAttribute(str).getId()).toString();
} catch (Exception e) {
logger.log(Level.SEVERE, “Attribute <” + str + “> not found.”, e.getMessage());
}
return strVal;
}
I thought it should be as easy as using ICell. Try:
IItem item = eventInfo.getDataObject();
String old_page_three_value = (String) item.getCell(CommonConstants.ATT_PAGE_THREE_LIST19).toString(); //I’ve had issues with the .getValue() method in Java versus doing the same thing in Groovy