KVSKBAComJnlPostLine
Procedures
OnRun
Summary: OnRun trigger that posts a single commission journal line after validation.
procedure OnRun(Rec: Record "KVSKBACommissionJournalLine")
RunWithCheck(Record KVSKBACommissionJournalLine) :
Summary: Posts a commission journal line after performing validation checks. This function validates the journal line, creates commission entries, and updates source documents.
procedure RunWithCheck(var OriginalCommissionJournalLine: Record "KVSKBACommissionJournalLine"):
Parameters:
OriginalCommissionJournalLine: The commission journal line that needs to be posted.
Remarks: The procedure performs the following operations: 1. Validates the journal line using ComJnlCheckLine codeunit 2. Creates commission entry records with all relevant data 3. Handles correction entries and validates correction logic 4. Updates sales invoice/credit memo lines to mark commission as posted 5. Manages commission register for tracking purposes Supports both regular and correction entries for salesperson and 2nd salesperson calculations.
Events
OnCodeOnAfterInsertCommissionEntry(Record KVSKBACommissionJournalLine, Record KVSKBACommissionEntry) :
Summary: Integration Event that is raised after inserting a commission entry record. Use this event to perform additional processing after the commission entry has been created.
[IntegrationEvent(false, false)]
local procedure OnCodeOnAfterInsertCommissionEntry(KVSKBACommissionJournalLine: Record "KVSKBACommissionJournalLine"; var KVSKBACommissionEntry: Record "KVSKBACommissionEntry"):
Parameters:
KVSKBACommissionJournalLine: The commission journal line that was posted.KVSKBACommissionEntry: The commission entry record that was created and inserted.
Remarks: This event allows external extensions to perform additional operations after a commission entry has been successfully created, such as creating related records or triggering notifications.
OnCodeOnBeforeInsertCommissionEntry(Record KVSKBACommissionJournalLine, Record KVSKBACommissionEntry) :
Summary: Integration Event that is raised before inserting a commission entry record. Use this event to modify commission entry data or perform validation before insertion.
[IntegrationEvent(false, false)]
local procedure OnCodeOnBeforeInsertCommissionEntry(KVSKBACommissionJournalLine: Record "KVSKBACommissionJournalLine"; var KVSKBACommissionEntry: Record "KVSKBACommissionEntry"):
Parameters:
KVSKBACommissionJournalLine: The commission journal line being posted.KVSKBACommissionEntry: The commission entry record that will be inserted. Modify this record as needed.
Remarks: This event allows external extensions to customize commission entry data before it is inserted into the database. All standard fields have already been populated from the journal line.