Description: Opens the reason-detail editor for one reason in the current record, or in a separately loaded target record when both optional target arguments are supplied.
Calling convention: CallEditReasonItemByIndex("ContainerName": String, ReasonIndexInContainer: Integer, "TimeToExplainEntryName": String, ["ObjectName": String], [DATAID: Integer]): Variant
Parameters:
ContainerName: reason or reason-volume container.
ReasonIndexInContainer: zero-based index; -1 selects the last reason, while values below -1 are invalid.
TimeToExplainEntryName: optional entry used to calculate unexplained time; pass an empty string to disable it.
ObjectName: optional target object, accepted only together with DATAID in the five-argument form.
DATAID: optional non-NULL target record ID.
Returns: Selected global ReasonID after OK, NULL after cancellation, or false before selected exceptions.
Availability: Default desktop UI; accepts exactly 3 or 5 arguments and requires a visible current record for the three-argument form.
Example:
ReasonID := CallEditReasonItemByIndex("DowntimeReasons", -1, "TimeToExplain");