KVSKBAOrderFlowLib#
Procedures#
SalesLineUpdByOrderRelease(Record Sales Line, Record Sales Header) :#
Summary: For the SalesLine a new record "KVSKBAOrderFlowEntry" will be created with the fields: OrderFlowEntry."Curr. Order Entry" = TRUE OrderFlowEntry.Quantity, OrderFlowEntry."Remaing Qty. To Invoice" = the not invoiced quantity of the SalesLine
procedure SalesLineUpdByOrderRelease(SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"):
Parameters:
SalesLine: The sales line to process.SalesHeader: The sales header context.
Remarks: Only processes Sales Orders and Sales Return Orders. Requires document status to be Released or Pending Prepayment. Creates order flow entry with quantity and amount not yet invoiced. For Return Orders, quantities and amounts are negated. Entry date is calculated based on Sales Setup configuration. Only executed if KVSKBACreateOrderInflow is enabled in Sales Setup. Lines must have Type unequal " ", No. unequal '', and Quantity unequal 0 to be processed. Integration events allow customization of entry creation.
SalesLineUpdByOrderReopen(Record Sales Line, Record Sales Header) :#
Summary: The function will to use in Sales for documents "Sales Orders" and "Sales Return Orders" when the document get the Status::Open. All existing orderFlowEntryLoc of the document Line with OrderFlowEntry."Curr. Order Entry" = true will be negated by inserting new Entries
procedure SalesLineUpdByOrderReopen(SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"):
Parameters:
SalesLine: The sales line to process.SalesHeader: The sales header context.
Remarks: Only processes Sales Orders and Sales Return Orders. Finds all current order entries for the line and decreases them to zero. Only executed if KVSKBACreateOrderInflow is enabled in Sales Setup. Document must have Status = Open when called. Entry date is calculated based on Sales Setup configuration. Used both for reopening documents and for over-/underdelivery scenarios.
DecrOrderFlowEntryOfCurrOrder(Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#
Summary: A existing orderFlowEntry with "Curr. Order Entry" = TRUE will be drecrease by inserting a new Entry
procedure DecrOrderFlowEntryOfCurrOrder(OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date):
Parameters:
OrderFlowEntry: The order flow entry to decrease.QtyToDecrease: The quantity to decrease by.NewEntrySource: The entry source for the new entry.CalcEntryDate: The entry date for the new entry.
Remarks: Creates a new negative entry to decrease the remaining quantity. Updates the original entry's "Remaing Qty. To Invoice" field. Sets "Curr. Order Entry" to false if remaining quantity becomes zero. Validates that QtyToDecrease does not exceed "Remaing Qty. To Invoice". Validates that QtyToDecrease has the same sign as the original quantity. The new entry references the original via "Belong to Released Entry No.".
GetNextEntryNo() : Integer#
Summary: Retrieves the next available entry number for order flow entries.
procedure GetNextEntryNo(): Integer
Returns: The next entry number (last entry number + 1, or 1 if no entries exist).
Remarks: Locks the table to ensure no concurrent inserts. Use this before inserting new order flow entries to maintain unique entry numbers.
CalcFlowEntryPricesAndQtyBase(Record KVSKBAOrderFlowEntry, Date) :#
Summary: For a orderFlowEntry some fields will be calculated on the base of the significant fields
procedure CalcFlowEntryPricesAndQtyBase(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; CalcEntryDate: Date):
Parameters:
OrderFlowEntry: The order flow entry to calculate fields for (modified by reference).CalcEntryDate: The date for currency exchange calculations.
Remarks: Calculates LCY fields using currency exchange rates if currency code is set. Calculates: "Unit Price (LCY)", "Amount (LCY)", "Inv. Discount Amount (LCY)". If no currency code is set, LCY fields are copied from the base fields. Calculates "Quantity (Base)" using unit of measure conversion. This procedure should be called whenever quantity, amount, or currency fields change.
Events#
OnAfterSalesHeaderUpdByOrderDelete(Record Sales Header) :#
Summary: Integration event triggered after order flow entries are created for a deleted sales header.
[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderDelete(SalesHeader: Record "Sales Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderDelete', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderDelete(SalesHeader: Record "Sales Header")
begin
end;
Parameters:
SalesHeader: The sales header that was deleted.
Remarks: Use this event to perform additional processing after document deletion. Subscribe to this event for logging, notifications, or related cleanup operations.
OnAfterSalesHeaderUpdByOrderRelease(Record Sales Header) :#
Summary: Integration event triggered after order flow entries are created for a released sales header.
[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderRelease(SalesHeader: Record "Sales Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderRelease', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderRelease(SalesHeader: Record "Sales Header")
begin
end;
Parameters:
SalesHeader: The sales header that was released.
Remarks: Use this event to perform additional processing after document release. Subscribe to this event for logging, notifications, or workflow integrations.
OnAfterSalesHeaderUpdByOrderReopen(Record Sales Header) :#
Summary: Integration event triggered after order flow entries are created for a reopened sales header.
[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderReopen(SalesHeader: Record "Sales Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderReopen', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderReopen(SalesHeader: Record "Sales Header")
begin
end;
Parameters:
SalesHeader: The sales header that was reopened.
Remarks: Use this event to perform additional processing after document reopening. Subscribe to this event for logging, notifications, or cleanup operations.
OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Header, Record Sales Line) :#
Summary: Integration event triggered after inserting an order flow entry for a released sales line.
[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
begin
end;
Parameters:
OrderFlowEntry: The inserted order flow entry.SalesHeader: The sales header context.SalesLine: The sales line that was processed.
Remarks: Use this event to modify or extend order flow entries after creation. Subscribe to add custom fields or trigger related processes.
OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Header, Record Sales Line) :#
Summary: Integration event triggered before inserting an order flow entry for a released sales line.
[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
begin
end;
Parameters:
OrderFlowEntry: The order flow entry to be inserted (can be modified).SalesHeader: The sales header context.SalesLine: The sales line being processed.
Remarks: Use this event to modify order flow entry fields before insertion. Subscribe to add custom validations or set additional fields.
OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Invoice Header, Record Sales Invoice Line) :#
Summary: Integration event triggered after inserting an order flow entry for a posted invoice line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line")
begin
end;
Parameters:
OrderFlowEntry: The inserted order flow entry.SalesInvoiceHeader: The posted sales invoice header.SalesInvoiceLine: The posted sales invoice line.
Remarks: Use this event to extend order flow entry processing after invoice posting. Subscribe to add logging, analytics, or related data updates.
OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Invoice Header, Record Sales Invoice Line) :#
Summary: Integration event triggered before inserting an order flow entry for a posted invoice line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line")
begin
end;
Parameters:
OrderFlowEntry: The order flow entry to be inserted (can be modified).SalesInvoiceHeader: The posted sales invoice header.SalesInvoiceLine: The posted sales invoice line.
Remarks: Use this event to modify order flow entry fields before insertion. Subscribe to add custom validations or calculations for invoice-related entries.
OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Cr.Memo Header, Record Sales Cr.Memo Line) :#
Summary: Integration event triggered after inserting an order flow entry for a posted credit memo line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line")
begin
end;
Parameters:
OrderFlowEntry: The inserted order flow entry.SalesCrMemoHeader: The posted sales credit memo header.SalesCrMemoLine: The posted sales credit memo line.
Remarks: Use this event to extend order flow entry processing after credit memo posting. Subscribe to add logging, analytics, or related data updates.
OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Cr.Memo Header, Record Sales Cr.Memo Line) :#
Summary: Integration event triggered before inserting an order flow entry for a posted credit memo line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line")
begin
end;
Parameters:
OrderFlowEntry: The order flow entry to be inserted (can be modified).SalesCrMemoHeader: The posted sales credit memo header.SalesCrMemoLine: The posted sales credit memo line.
Remarks: Use this event to modify order flow entry fields before insertion. Subscribe to add custom validations or calculations for credit memo-related entries.
OnBeforeCheckDocumentType(Record Sales Header, Record Sales & Receivables Setup, Boolean) :#
Summary: Integration event triggered before checking document type for order flow processing.
[IntegrationEvent(false, false)]
local procedure OnBeforeCheckDocumentType(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeCheckDocumentType', '', false, false)]
local procedure DoSomethingOnBeforeCheckDocumentType(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesHeader: The sales header being checked.SalesReceivablesSetup: The sales setup containing configuration.IsHandled: Set to true to skip the standard document type check.
Remarks: Use this event to extend document type validation beyond Orders and Return Orders. Set IsHandled to true to implement completely custom document type logic.
OnBeforeUpdByPostingACrMemoLine(Record Sales Cr.Memo Header, Record Sales Cr.Memo Line, Boolean) :#
Summary: Integration event triggered before updating order flow for a posted credit memo line.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdByPostingACrMemoLine(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeUpdByPostingACrMemoLine', '', false, false)]
local procedure DoSomethingOnBeforeUpdByPostingACrMemoLine(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesCrMemoHeader: The posted sales credit memo header.SalesCrMemoLine: The posted sales credit memo line.IsHandled: Set to true to skip standard order flow update.
Remarks: Use this event to implement custom order flow logic for credit memos. Set IsHandled to true to completely replace the standard processing.
OnBeforeUpdByPostingAInvoiceLine(Record Sales Invoice Header, Record Sales Invoice Line, Boolean) :#
Summary: Integration event triggered before updating order flow for a posted invoice line.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdByPostingAInvoiceLine(SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeUpdByPostingAInvoiceLine', '', false, false)]
local procedure DoSomethingOnBeforeUpdByPostingAInvoiceLine(SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesInvoiceHeader: The posted sales invoice header.SalesInvoiceLine: The posted sales invoice line.IsHandled: Set to true to skip standard order flow update.
Remarks: Use this event to implement custom order flow logic for invoices. Set IsHandled to true to completely replace the standard processing.
OnAfterSalesLineSetFilter(Record Sales Header, Record Sales & Receivables Setup, Record Sales Line) :#
Summary: Integration event triggered after setting filters on sales lines for order flow processing.
[IntegrationEvent(false, false)]
local procedure OnAfterSalesLineSetFilter(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var SalesLine: Record "Sales Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesLineSetFilter', '', false, false)]
local procedure DoSomethingOnAfterSalesLineSetFilter(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var SalesLine: Record "Sales Line")
begin
end;
Parameters:
SalesHeader: The sales header context.SalesReceivablesSetup: The sales setup containing configuration.SalesLine: The sales line record with filters applied (can be modified).
Remarks: Use this event to add additional filters to sales lines. Subscribe to exclude specific lines from order flow processing based on custom criteria.
OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(Record Sales Line, Decimal) :#
Summary: Integration event triggered after calculating not invoiced quantity for a sales line.
[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(SalesLine: Record "Sales Line"; var QtyNotInvoiced: Decimal):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(SalesLine: Record "Sales Line"; var QtyNotInvoiced: Decimal)
begin
end;
Parameters:
SalesLine: The sales line being processed.QtyNotInvoiced: The calculated not invoiced quantity (can be modified).
Remarks: Use this event to adjust the not invoiced quantity calculation. Subscribe to implement custom logic for determining remaining quantities.
OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(Record Sales Line, Record KVSKBAOrderFlowEntry) :#
Summary: Integration event triggered when setting source document for an order flow entry.
[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(SalesLine: Record "Sales Line"; var KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(SalesLine: Record "Sales Line"; var KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry")
begin
end;
Parameters:
SalesLine: The sales line being processed.KVSKBAOrderFlowEntry: The order flow entry (can be modified).
Remarks: Use this event to set custom source document types beyond the standard Orders and Return Orders. Subscribe to extend source document handling for custom document types.
OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(Record Sales Invoice Line, Record Sales Invoice Header, Record Sales & Receivables Setup, Integer, Integer, Code[20], Integer, Integer, Enum KVSKBAOrdFlowSourceDocument, Boolean) :#
Summary: Integration event triggered before retrieving document information for a sales invoice line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(SalesInvoiceLine: Record "Sales Invoice Line"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(SalesInvoiceLine: Record "Sales Invoice Line"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesInvoiceLine: The sales invoice line being processed.SalesInvoiceHeader: The sales invoice header context.SalesReceivablesSetup: The sales setup configuration.OrderTableNo: Output: Order table number (can be set).OrderDocType: Output: Order document type (can be set).OrderDocNo: Output: Order document number (can be set).OrderDocLineNo: Output: Order line number (can be set).OrderDocSubLineNo: Output: Order subline number (can be set).KVSKBAOrdFlowSourceDocument: Output: Source document enum (can be set).IsHandled: Set to true to skip standard document identification.
Remarks: Use this event to implement custom logic for identifying the source order of an invoice line. Set IsHandled to true and provide the order information to bypass standard logic. Useful for custom order types or special invoice-order relationships.
OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(Record Sales Cr.Memo Line, Record Sales Cr.Memo Header, Record Sales & Receivables Setup, Integer, Integer, Code[20], Integer, Integer, Enum KVSKBAOrdFlowSourceDocument, Boolean) :#
Summary: Integration event triggered before retrieving document information for a sales credit memo line.
[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesCrMemoLine: The sales credit memo line being processed.SalesCrMemoHeader: The sales credit memo header context.SalesReceivablesSetup: The sales setup configuration.OrderTableNo: Output: Order table number (can be set).OrderDocType: Output: Order document type (can be set).OrderDocNo: Output: Order document number (can be set).OrderDocLineNo: Output: Order line number (can be set).OrderDocSubLineNo: Output: Order subline number (can be set).KVSKBAOrdFlowSourceDocument: Output: Source document enum (can be set).IsHandled: Set to true to skip standard document identification.
Remarks: Use this event to implement custom logic for identifying the source order of a credit memo line. Set IsHandled to true and provide the order information to bypass standard logic. Useful for custom order types or special credit memo-order relationships.
OnBeforeDecrOrderFlowEntryOfCurrOrder(Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date, Boolean) :#
Summary: Integration event triggered before decreasing an order flow entry.
[IntegrationEvent(false, false)]
local procedure OnBeforeDecrOrderFlowEntryOfCurrOrder(KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeDecrOrderFlowEntryOfCurrOrder', '', false, false)]
local procedure DoSomethingOnBeforeDecrOrderFlowEntryOfCurrOrder(KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date; var IsHandled: Boolean)
begin
end;
Parameters:
KVSKBAOrderFlowEntry: The order flow entry to be decreased.QtyToDecrease: The quantity to decrease by.NewKVSKBAOrderFlowEntrySource: The entry source for the new entry.CalcEntryDate: The entry date for the new entry.IsHandled: Set to true to skip standard decrease logic.
Remarks: Use this event to implement custom logic for decreasing order flow entries. Set IsHandled to true to completely replace the standard decrease processing.
OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(Record KVSKBAOrderFlowEntry, Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#
Summary: Integration event triggered before inserting a new order flow entry during decrease operation.
[IntegrationEvent(false, false)]
local procedure OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(var NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry', '', false, false)]
local procedure DoSomethingOnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(var NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date)
begin
end;
Parameters:
NewKVSKBAOrderFlowEntry: The new order flow entry to be inserted (can be modified).OldKVSKBAOrderFlowEntry: The original order flow entry being decreased.QtyToDecrease: The quantity being decreased.NewKVSKBAOrderFlowEntrySource: The entry source for the new entry.CalcEntryDate: The entry date for the new entry.
Remarks: Use this event to modify the new entry before insertion. Subscribe to add custom fields or validations during decrease operations.
OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(Record KVSKBAOrderFlowEntry, Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#
Summary: Integration event triggered before modifying the original order flow entry during decrease operation.
[IntegrationEvent(false, false)]
local procedure OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; var OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry', '', false, false)]
local procedure DoSomethingOnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; var OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date)
begin
end;
Parameters:
NewKVSKBAOrderFlowEntry: The new order flow entry that was inserted.OldKVSKBAOrderFlowEntry: The original order flow entry being updated (can be modified).QtyToDecrease: The quantity that was decreased.NewKVSKBAOrderFlowEntrySource: The entry source used.CalcEntryDate: The entry date used.
Remarks: Use this event to modify the original entry before it's updated with new remaining quantity. Subscribe to add custom field updates during decrease operations.