Calling convention: SetReasonCustomEntryByIndex("ContainerName": String, ReasonIndexInContainer : Integer, Value: Variant, "CustomEntryName": String, ["TargetObjectName": String], [TargetDataID]): Boolean
Description: Sets a custom entry value on a reason at a specified index. Index -1 selects the last reason. Optional target arguments allow editing another record.
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.
Value: Variant value to assign.
CustomEntryName: custom reason-entry name.
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 custom reason entry is updated; False for a NULL container/index or an out-of-range index. Invalid target data or an unknown custom entry can raise an error.
Availability: Default; requires a current record unless TargetObjectName and TargetDataID are supplied.
Example:
SetReasonCustomEntryByIndex("DowntimeReasons", -1, "A1", "ReasonCode");