getControlAttribute()
This function can be used in a hook to get the value of any controlling attribute as available in a request. It must not be used in batch implementations.
The control data is available in the before/on/after execute hooks for each method and for each component. Both standard control data and non-standard control data (for specific methods) can be used.
See also section Guidelines on Using or Setting Attribute Implementation Values.
function boolean getControlAttribute(
const string i.name,
ref string o.value)
Input:
i.name: name of the controlling attribute.
Output:
- return value: true if the control attribute exists in the request and its value can be retrieved, false otherwise.
- o.value: the value of the control attribute, “” if return value is false.
For example:
string batchString(12)
long batchNumber
if not getControlAttribute(“batch”, batchString) then
batchNumber = 0
else
batchNumber = lval(batchString)
endif
do.something(batchNumber)
return(0) | OK