reqFieldExist()

This procedure checks if given field exists in request “control:fields” section. There is special section in request. Caller can use this section to subset returned data. This procedure is mostly used internally in API framework and there is no needs to use it from RPG manager program.

ParameterTypeDescription
fieldName1024A VARYING, VARSIZEMandatoryName of field which is searched in request “control”{“fields”:[…] table

Function reqFieldExist checks if given field exists in section “control:fields”. If so, it returns *ON. If not exists then return *OFF. If there is no section control, then procedure always returns *ON.

examples: The request can look like this:

{"IptorAPI":"1.0","method":"itemBatch.get","params":{"item":"PLMB02","warehouse":"MK5","batch":"A"},"control":{"fields":["item", "warehouse"]},"id":"j7g8an8h"}

Section “control:fields” provides list of fields which should be returned back. In this example the caller wants to receive back only “item” and ”warehouse”. In the manager program the reqFieldExist() can be used to determine if the value should be returned.

if reqFieldExist('item'); 
.
if reqFieldExist('warehouse');