Description: Finds the root reason of a reason hierarchy and returns its ID.
Calling convention: CIP_GetTopLevelReasonID(ReasonID: Integer): Integer
Parameters:
ReasonID: ID of the starting reason. Variant NULL is accepted.
Returns: ID of the highest ancestor, or the supplied reason's own ID when it has no parent. Variant NULL input returns NULL. An unknown reason ID raises an exception.
Availability: Default; reads the globally loaded reason hierarchy.
Example:
MainReasonID := CIP_GetTopLevelReasonID(ReasonID);