InputRowset method: Business Interlink class

Syntax

InputRowset(&Rowset)

Description

The InputRowset method uses the data in the specified rowset to populate the input buffer, copying like-named fields in the appropriate structure. This method assumes that the names of the fields in the rowset match the names of the inputs defined in the Business Interlink definition, and that the structure of both rowsets are the same.

Use this method only if you have a hierarchical data structure and you want to preserve the hierarchy. Otherwise, use BulkExecute or AddInputRow.

Parameters

Parameter Description

&Rowset

Specify an existing, instantiated rowset object.

Returns

An optional value: the number of rows inserted into the output buffer.

Example

The example uses the rowset on level one from the EMPLOYEE_CHECKLIST page. A PeopleCode program running in a field on level zero in that panel can access the child rowset (level one), shown below from Scroll Bar 1 to Scroll Bar 2.

EMPLOYEE_CHECKLIST Page structure

EMPL_CHECKLIST is the primary database record for the level one scrollbar on the EMPLOYEE_CHECKLIST page. The following PeopleCode access the level one rowset using EMPL_CHECKLIST. The Business Interlink object name is QE_BI_EMPL_CHECKLIST. This Business Interlink object uses the level one rowset as its input and its output.

The InputRowset method uses this rowset as input for QE_BI_EMPL_CHECKLIST. Then a blank duplicate of the rowset is created with CreateRowset, and then the output of QE_BI_EMPL_CHECKLIST is fetched into the blank rowset with FetchIntoRowset.

&MYROWSET = GetRowset(SCROLL.EMPL_CHECKLIST); 
&ROWCOUNT = &QE_BI_EMPL_CHECKLIST.InputRowset(&MYROWSET);
&RSLT = &QE_BI_EMPL_CHECKLIST.Execute();
/* do some error processing */
&WorkRowset = CreateRowset(&MYROWSET);
&ROWCOUNT = &QE_BI_EMPL_CHECKLIST.FetchIntoRowset(&WorkRowset); 
If &ROWCOUNT = 0 Then 
/* do some error processing */ 
Else 
   /* Process the rowset from QE_BI_EMPL_CHECKLIST. Check it for errors. */ 
   For &I = 1 to &WorkRowset.RowCount 
      For &K = 1 to &WorkRowset(&I).RecordCount 
         &REC = &WorkRowset(&I).GetRecord(&K); 
         &REC.ExecuteEdits(); 
         For &M = 1 to &REC.FieldCount 
            If &REC.GetField(&M).EditError Then  
            /* there are errors */ 
            /* do other processing */ 
            End-If; 
         End-For; 
      End-For; 
   End-for; 
End-if;