GetFieldValue method: Business Interlink class
Syntax
GetFieldValue(index)
Description
Use the GetFieldValue method to support dynamic output. It returns the value of the field specified by index. You can use this method only after you have used the MoveFirst method: otherwise the system doesn’t know where to start.
Note:
This method can also be used with hierarchical doc data.
Parameters
| Parameter | Description |
|---|---|
|
index |
Specify the number of the field you want to find the value of. |
Returns
A string containing the value of the field.
Example
In the following example, the Business Interlink object name is &MYBI. The example uses MoveFirst to move to the first row of the output buffer, and to the first column, or first field, in that row. The Repeat loop uses MoveNext to go through every row in the output buffer. The For loop processes every field in every row, using the GetFieldCount method to get the number of fields, or outputs, in the row. Within the For loop, GetFieldValue gets the value of the field data.
/* Add inputs to the Business Interlink object, then call Execute to execute
the Business Interlink object. You are then ready to get the
outputs using the following code. */
If (&MYBI.MoveFirst()) Then
Repeat
For &I = 1 to &MYBI.GetFieldCount
&TYPE = &MYBI.GetFieldType(&I);
Evaluate &TYPE
Where = 1
&STRING_VARIABLE = &MYBI.GetFieldValue(&I);
/* test for and process other field types */
End-Evaluate;
End-For;
Until Not(&MYBI.MoveNext());
Else
/* Process error - no output buffer */
End-If;