Skip to content

KVSCLQChangeLogLib#

Summary: Provides functionality for accessing the Change Log super fast.

Procedures#

ShowChangeLogEntries(RecordId) :#

Summary: Opens the Change Log for the given record. It does not show only changes to the record itself but also on related records.

procedure ShowChangeLogEntries(RecID: RecordId): 

Parameters:

  • RecID: The given RecordId to search the change log for.

Events#

OnBeforeSetFilteronPrimaryKeyFieldsatChangeLogEntryCaseElse(Record Change Log Entry, RecordId, Boolean) :#

Summary: Use this Event to filter on the required Primary Key Fields of your custom Change Log Quick Access implementation.

[IntegrationEvent(false, false)]
local procedure OnBeforeSetFilteronPrimaryKeyFieldsatChangeLogEntryCaseElse(var ChangeLogEntry: Record "Change Log Entry"; RecID: RecordId; var isCaseHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSCLQChangeLogLib", 'OnBeforeSetFilteronPrimaryKeyFieldsatChangeLogEntryCaseElse', '', false, false)]
local procedure DoSomethingOnBeforeSetFilteronPrimaryKeyFieldsatChangeLogEntryCaseElse(var ChangeLogEntry: Record "Change Log Entry"; RecID: RecordId; var isCaseHandled: Boolean)
begin
end;

Parameters:

  • ChangeLogEntry: The Change Log Entry which should be filtered
  • RecID: The RecordId of the Record which the Change Log is requested for.
  • isCaseHandled: Should be set to true if the case was handled. Otherwise the filters will be overwritten to the Primary Key of RecId.

Example: Filter only on the first Primary Key field so the Change Log Entries for all Lines in "My Lines" will also be displayed

if RecID.TableNo() = database::"My Header" then begin
    VarFieldRef := VarKeyRef.FieldIndex(1);
    ChangeLogEntry.SETRANGE("Primary Key Field 1 Value", FORMAT(VarFieldRef.Value(), 0, 9));
end;

OnBeforeSetFilteronTableNoatChangeLogEntryCaseElse(Record Change Log Entry, RecordId, Boolean) :#

Summary: Use this Event to filter your custom Change Log Quick Access implementation on multible Tables.

[IntegrationEvent(false, false)]
local procedure OnBeforeSetFilteronTableNoatChangeLogEntryCaseElse(var ChangeLogEntry: Record "Change Log Entry"; RecID: RecordId; var isCaseHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSCLQChangeLogLib", 'OnBeforeSetFilteronTableNoatChangeLogEntryCaseElse', '', false, false)]
local procedure DoSomethingOnBeforeSetFilteronTableNoatChangeLogEntryCaseElse(var ChangeLogEntry: Record "Change Log Entry"; RecID: RecordId; var isCaseHandled: Boolean)
begin
end;

Parameters:

  • ChangeLogEntry: The Change Log Entry which should be filtered
  • RecID: The RecordId of the Record which the Change Log is requested for.
  • isCaseHandled: Must be set to true if the case was handled. Otherwise filter will be overwritten to the Table of RecId itself.

Example:

if RecID.TableNo() = database::"My Header" then ChangeLogEntry.Setfilter("Table No.", '%1|%2', database::"My Header", database::"My Line");isCaseHandled := true;