Calling convention: GetReasonValueByIndex("ContainerName": String, ReasonIndexInContainer: Integer, "CustomUserEntryName": String): Variant
Description: Returns a custom user-entry value from a reason at a specified position in a reason container. Index -1 selects the last reason.
Parameters:
ContainerName: reason-container entry name.
ReasonIndexInContainer: zero-based reason index, or -1 for the last reason.
CustomUserEntryName: custom reason-entry name. The implementation also accepts optional target object name and DATA_ID as a fourth and fifth argument; an explicit NULL DATA_ID raises an error.
Returns: Custom entry value as Variant; NULL for missing arguments or an out-of-range index. Invalid containers, custom entries or target objects raise an error.
Availability: Default; uses the current record unless the implementation-only target object and DATA_ID arguments are supplied.
Example:
ReasonCode := GetReasonValueByIndex("DowntimeReasons", 0, "ReasonCode");