GetNextDoc method: Business Interlink class
Syntax
GetNextDoc()
Description
The GetNextDoc method gets a document from one of the following levels:
-
The root level of the Output structure for a Business Interlink object. This level was accessed with the GetOutputDocs method.
-
When a document within the Output structure is a list, GetNextDoc gets another document from the list. If you use GetNextDoc on a document that is not a list, GetNextDoc fails and returns an error.
Parameters
None.
Returns
The following are the valid returns:
| Number | Enum Value | Description |
|---|---|---|
|
0 |
eNoError |
The method succeeded. |
|
1 |
eNO_DOCUMENT |
The document referenced by this method does not exist. |
|
2 |
eDOCLIST_OUT_RANGE |
You tried to access a document in a list, but the document list is out of range. For example, if a document list contains five documents, and then you call GetDoc/GetOutputDocs once, you can call GetNextDoc four times; the fifth time results in this error. |
|
3 |
eDOCUMENT_UNINITIALIZED |
Internal error |
|
4 |
eNOT_DOCUMENTTYPE |
You tried to perform an operation upon a parameter that is not a document type. |
|
5 |
eNOT_LISTTYPE |
You tried to perform a GetNextDoc or AddNextDoc upon a document that is not a list. |
|
7 |
eNOT_BASICTYPE |
You tried to perform a GetValue or AddValue upon a parameter that is not of basic type: Integer, Float, String, Time, Date, DateTime. |
|
8 |
eNO_DATA |
You tried to retrieve data from a document that contained no data. |
Example
In this example, the Output structure for Calculate Cost, or the root level document, is accessed with the GetOutputDocs method. The GetNextDoc method gets another Output structure, assuming that there is more than one of them. The Calculate Cost output parameter output_param2_List is a document, so the GetDoc method gets it to the Output structure. output_param2_List is also a document list, so GetNextDoc method gets the next output_param2_List document.
Local Interlink &QE_COST;
Local number &count1, &count2;
Local BIDocs &CalcCostOut;
Local BIDocs &OutlistDoc;
Local number &ret1, &ret2;
&QE_COST = GetInterlink(Interlink.QE_COST_EX);
// Get inputs, execute. (code not shown)
&CalcCostOut = &QE_COST.GetOutputDocs("");
&ret1 = 0;
While (&ret1)
&ret1 = &CalcCostOut.GetValue("output_param1",&VALUE);
&ServiceRateDoc = &CalcCostOut.GetDoc("Service_Rate");
&ret1 = &ServiceRateDoc.GetValue("Service_Type", &SERVICE_TYPE);
&ret1 = &ServiceRateDoc.GetValue("Rate", &RATE);
/* Process output values */
&OutlistDoc = &CalcCostOut.GetDoc("output_param2_List");
&count2 = &CalcCostOut.GetCount("output_param2_List");
While (&I < &count2)
&ret2 = &OutlistDoc.GetValue("output_member1", &VALUE1);
&ret2 = &OutlistDoc.GetValue("output_member2", &VALUE2);
If &ret2 = 0 Then
/* Process output values */
&I = &I + 1;
&ret2 = &OutlistDoc.GetNextDoc();
End-If; &ret1 = &CalcCostOut.GetNextDoc();
End-While;
The following shows the Output structure for this example. It contains three output parameters: output_param1, Service_Rate, and output_param2_List.
