LoadCollection examples

Loading a collection and returning properties

This sample code demonstrates executing a LoadCollection for the SLTtJobtMatPosts IDO, bringing back the TransNum and TransSeq properties.

LoadCollectionResponseData loadResponse; 
loadResponse =     .Context.Commands.LoadCollection( 
   "SLTtJobtMatPosts", 
   "TransNum,TransSeq", 
   [filter], 
         .Empty, 0);

Loading a collection for an IDO extension class

This sample demonstrates executing a LoadCollection for the IDO that the extension class belongs to (the current instance of the executing IDO).

LoadCollectionResponseData loadResponse; 
loadResponse =     .LoadCollection( 
   "TransNum, EmpNum, EmpEmpType, EmpDept, DerJobPWcDept ", 
   [filter], 
   "Posted, LowLevel DESC, Job, Suffix, CloseJob, TransNum", 0);

Iterating through items and accessing property values

This sample demonstrates one way to iterate through items in a LoadCollectionResponseData instance returned from a LoadCollection request, and how to access property values.

       empNum = null; 

    (    index = 0; index <= responseData.Items.Count; index++) 
{ 
      (!responseData[index, "EmpNum"].IsNull) 
   { 
      empNum = responseData[index, "EmpNum"].Value; 
      
   } 
}