on 2016 Mar 29 10:01 AM
Hello All,
We have requirement to read the sections and its clauses from the contract document template to validate the upload date via VALIDATE script event. I have written attached code. It returns correct collection size but when I access the records via index it returns null. Please let me know how to retrieve the details correctly to read the sections and its clause from contract document template
collSec = doc.getCollectionMetadata("SECTIONS").get(doc);
if (collSec.size() > 0 ) {
// returns correct number records in the standard collection
for (int i = collSec.size() - 1; i >= 0; --i){
section = collSec.get(i); // it fails. return null value if I refer the collection object with index
throw doc.createApplicationException("SECTIONS",collSec.get(i).toString());
if (hasValue(section)) {
//SECTION = IBeanHomeLocator.lookup(session,com.sap.eso.api.contractgen.SectionIBeanHomeImpl.sHOME_NAME).find(valueSection);
throw doc.createApplicationException("SECTIONS",section.toString()); } } }
Request clarification before answering.
Hi,
The code returns null because collSec.get(i) is not an actual Section(1803), it is a SectionSub(1804).
In RefGuide you can see that the SECTIONS collection in the template actually contains references to contractgen.SectionSub
Try this code:
section = collSec.get(i).getSectionObjRef();
*it should return an objRef you can pass on to the home class.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.