Calling convention: GETLastValByDataID("EntryName": String, ["FilterEntryName": String], [FilterEntryValue: Variant], [DefaultValue: Variant]): Integer
Description: Reads the requested entry from the latest record whose DATA_ID is smaller than the current record's DATA_ID, optionally restricted by an entry-value filter.
Parameters:
EntryName: entry whose previous value is requested.
FilterEntryName: optional entry used as an equality filter.
FilterEntryValue: optional filter value.
DefaultValue: optional fallback when no matching earlier record exists; to pass it as the fourth argument without filtering, use NULL for the two filter arguments.
Returns: The previous entry value, optional default, or a value supplied through the desktop workflow. Despite the registered Integer return type, the implementation returns a Variant and can therefore return text, dates or NULL.
Availability: Default; requires a current DB form and record.
Example:
PreviousStatus := GETLastValByDataID("Status", "Machine", MachineName, "Unknown");