Skip to Content
avatar image
Former Member

Problem accessing standard collection in contract template document

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,;
throw doc.createApplicationException("SECTIONS",section.toString()); } } }

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 29, 2016 at 01:31 PM


    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.



    Add comment
    10|10000 characters needed characters exceeded