KVSKBACLLCMPComplianceLib
Procedures
OnBeforeReopen(RecordRef) :
Summary: OnBeforeReopen. Called on before reopening a record. Within this procedure, it is checked if a new call header needs to be created.
procedure OnBeforeReopen(recRef: RecordRef):
Parameters:
recRef: RecordRef. Reference to the according record which needs to be reopened.
Remarks: Called from compliance event mgmt. It is checked if the record which needs to be reopened has an associated call header. If not, it is checked if the record is relevant for compliance and if yes, a call header will be created.
OnBeforeRelease(RecordRef, Boolean) : Code[20]
Summary: OnBeforeRelease. Called on before releasing a record. Within this procedure, it is checked if a new call header needs to be created.
procedure OnBeforeRelease(recRef: RecordRef; showError: Boolean): Code[20]
Parameters:
recRef: RecordRef. Reference to the according record which needs to be released.showError: Boolean. Defines if it is allowed to show an according error within the processing. If an approval of compliance action is not successful and the parameter showError is set to true, an error will be shown. If parameter showError is set to false, a message wil be shown instead.
Returns: Returns the unique No. of the according call header. Return value of type Code[20].
Remarks: Called from compliance event mgmt. It is checked if the record which needs to be released has an associated call header. If not, it is checked if the record is relevant for compliance and if yes, a call header will be created. Additionally, it is checked if the call header is in a status, that allows releasing the according record. If not, depending on the value of showError, an error or a message will be shown.
FindComplianceTable(Integer, Text, Record KVSKBACLLCMPComplianceTable) : Boolean
Summary: Finds the compliance table record for a given table number and primary key.
procedure FindComplianceTable(TableNo: Integer; PrimaryKey: Text; var CLLCMPComplianceTable: Record "KVSKBACLLCMPComplianceTable"): Boolean
Parameters:
TableNo: The table number for which to find the compliance record.PrimaryKey: The primary key of the record for which to find the compliance record.CLLCMPComplianceTable: The compliance table record variable to hold the found compliance record.
Returns: True if a matching compliance record is found; otherwise, false.
Remarks: This procedure finds the compliance table record for a given table number and primary key. It first filters the compliance table based on the provided table number and checks if there are any released compliance records. Then, it iterates through the filtered compliance records and checks if the associated document matches the criteria defined in the compliance fields. If a matching compliance record is found and the minimum amount requirement is met, it returns true. Otherwise, it continues searching until all relevant compliance records have been checked, and if no matching record is found, it returns false.
CheckSubtable(RecordRef, Integer, Boolean, Text, Text) :
Summary: Checks the subtables for compliance when creating or releasing a call.
procedure CheckSubtable(RecRef: RecordRef; TableNo: Integer; IsReleased: Boolean; MainTableField: Text; MainTableFieldValue: Text):
Parameters:
RecRef: The record reference of the main table record for which to check the subtables.TableNo: The table number of the main table.IsReleased: A boolean value indicating whether the main table record is being released or not.MainTableField: The name of the main table field that is relevant for the compliance check.MainTableFieldValue: The value of the main table field that is relevant for the compliance check.
Remarks: This procedure checks the subtables for compliance when creating or releasing a call. It first checks if the compliance check is relevant for the module management. Then, it retrieves the call header associated with the main table record. If the call header is found and is not released, it checks if there is a compliance action associated with the call header. If there is a compliance action and the table number of the main table record matches either the main table or the subtable filter defined in the compliance table, it raises an error indicating that the record cannot be modified due to the existing compliance action. If there is no compliance action associated with the call header, it checks if there is a compliance table associated with the main table record. If there is a compliance table and the table number of the main table record matches either the main table or the subtable filter defined in the compliance table, it raises an error indicating that the record cannot be modified due to its release status.
Events
OnBeforeAmountCheckAtFindComplianceTable(Record KVSKBACLLCMPComplianceTable, RecordRef, Boolean) :
Summary: Integration event raised before amount-based filtering is applied when finding a compliance table.
[IntegrationEvent(false, false)]
local procedure OnBeforeAmountCheckAtFindComplianceTable(complianceTable: Record "KVSKBACLLCMPComplianceTable"; recRef: RecordRef; var isInFilter: Boolean):
Parameters:
complianceTable: The compliance table currently being evaluated.recRef: The source record reference used for evaluation.isInFilter: Output parameter indicating whether the record is included by amount checks.
Remarks: Subscribers can implement custom amount logic to include or exclude records from compliance processing. Set isInFilter to override the default amount check result.
OnAfterFindRecOnBeforeReopen(Integer, Text, Record KVSKBACLLCMPComplianceTable) :
Summary: Integration event raised after finding the source record and before reopening processing starts.
[IntegrationEvent(false, false)]
local procedure OnAfterFindRecOnBeforeReopen(tableNo: Integer; primaryKey: Text; complianceTable: Record "KVSKBACLLCMPComplianceTable"):
Parameters:
tableNo: The table number of the source record.primaryKey: The primary key value of the source record.complianceTable: The compliance table definition used for the process.
Remarks: Subscribers can add validations, logging, or preparatory logic before the compliance-related reopen operation continues.
OnBeforeInsertCallHeaderOnCreateCall(Record KVSKBACLLCallHeader) :
Summary: Integration event raised before inserting a call header during call creation.
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertCallHeaderOnCreateCall(var callHeader: Record "KVSKBACLLCallHeader"):
Parameters:
callHeader: The call header record to be inserted.
Remarks: Subscribers can modify default values, assign additional fields, or run checks before the call header is inserted.
OnAfterInsertCallHeaderOnCreateCall(Record KVSKBACLLCallHeader) :
Summary: Integration event raised after inserting a call header during call creation.
[IntegrationEvent(false, false)]
local procedure OnAfterInsertCallHeaderOnCreateCall(var callHeader: Record "KVSKBACLLCallHeader"):
Parameters:
callHeader: The inserted call header record.
Remarks: Subscribers can run post-insert actions such as related record initialization, notifications, or synchronization logic.
OnAfterCreateCallHeader(Record KVSKBACLLCallHeader) :
Summary: Integration event raised after call header creation is completed.
[IntegrationEvent(false, false)]
local procedure OnAfterCreateCallHeader(var callHeader: Record "KVSKBACLLCallHeader"):
Parameters:
callHeader: The created call header record.
Remarks: Subscribers can implement final post-processing for newly created compliance calls after all standard creation steps are finished.