Calling convention: GetReasonIDByIndex("ContainerName": String, ReasonIndexInContainer: Integer): Integer
Description: Returns the reason ID 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. The implementation also accepts optional target object name and DATA_ID as a third and fourth argument.
Returns: Integer reason ID, or NULL for missing arguments or an out-of-range index. Invalid containers 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:
ReasonID := GetReasonIDByIndex("DowntimeReasons", 0);