Description: Sets the DB_REMARK value of a reason at a specified index. Index -1 selects the last reason; NULL is stored as an empty string. Optional target arguments allow editing another record.
Calling convention: SetReasonRemarkByIndex("ContainerName": String, ReasonIndexInContainer: Integer, RemarkToS0t: Integer, ["TargetObjectName": String], [TargetDataID: Integer]): Boolean
Parameters:
ContainerName: reason-container entry name.
ReasonIndexInContainer: zero-based reason index, or -1 for the last reason; values below -1 are invalid and return False.
RemarkToS0t: remark value; despite the registered Integer type, the value is stored as text.
TargetObjectName: optional external object name.
TargetDataID: optional external DATA_ID; both target arguments must be supplied together and neither may be NULL.
Returns: True when the reason is updated; False for a NULL container/index or an out-of-range index. Invalid target data can raise an error.
Availability: Default; requires a current record unless TargetObjectName and TargetDataID are supplied.
Example:
SetReasonRemarkByIndex("DowntimeReasons", -1, "Checked by operator");