KVSKBAVATRateChangeConversion
OBSOLETE
This Element will be removed or changed with a future Version of the App.
Procedures
UpdateTable(Integer, Boolean, Boolean) :
Summary: Updates all records in the specified table by converting VAT product posting group and/or general product posting group codes according to the active VAT rate change conversion entries.
procedure UpdateTable(TableID: Integer; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean):
Parameters:
TableID: The database table ID of the table to update.ConvertVATProdPostingGroup: Set to true to convert VAT product posting group codes.ConvertGenProdPostingGroup: Set to true to convert general product posting group codes.
Remarks: Opens the table via RecordRef, iterates all records and calls UpdateRec for each one. If both conversion flags are false, the procedure exits immediately without processing. Raises OnBeforeUpdateTable to allow subscribers to replace the standard logic entirely. Progress is reported via the ProgressWindow dialog.
GetNextPurchaseLineNo(Record Purchase Line, Integer) : Boolean
Summary: Calculates the next available line number for a new purchase line to be inserted on the same document.
procedure GetNextPurchaseLineNo(PurchaseLine: Record "Purchase Line"; var NextLineNo: Integer): Boolean
Parameters:
PurchaseLine: The purchase line after which the new line will be inserted.NextLineNo: Returns the calculated next available line number.
Returns: True if a valid next line number was determined; false otherwise.
Remarks: Attempts to find a gap between the given line and the immediately following line and uses the midpoint as the new line number. If no gap is available, the new line is appended at the end of the document with an increment of 10,000. Returns false if no distinct line number could be calculated (i.e. NextLineNo would equal the original line number).
GetNextSalesLineNo(Record Sales Line, Integer) : Boolean
Summary: Calculates the next available line number for a new sales line to be inserted on the same document.
procedure GetNextSalesLineNo(SalesLine: Record "Sales Line"; var NextLineNo: Integer): Boolean
Parameters:
SalesLine: The sales line after which the new line will be inserted.NextLineNo: Returns the calculated next available line number.
Returns: True if a valid next line number was determined; false otherwise.
Remarks: Attempts to find a gap between the given line and the immediately following line and uses the midpoint as the new line number. If no gap is available, the new line is appended at the end of the document with an increment of 10,000. Returns false if no distinct line number could be calculated (i.e. NextLineNo would equal the original line number).
GetNextServiceLineNo(Record Service Line, Integer) : Boolean
Summary: Calculates the next available line number for a new service line to be inserted on the same document.
procedure GetNextServiceLineNo(ServiceLine: Record "Service Line"; var NextLineNo: Integer): Boolean
Parameters:
ServiceLine: The service line after which the new line will be inserted.NextLineNo: Returns the calculated next available line number.
Returns: True if a valid next line number was determined; false otherwise.
Remarks: Attempts to find a gap between the given line and the immediately following line and uses the midpoint as the new line number. If no gap is available, the new line is appended at the end of the document with an increment of 10,000. Returns false if no distinct line number could be calculated (i.e. NextLineNo would equal the original line number).
Events
OnAddNewPurchaseLineOnBeforeOldPurchaseLineModify(Record Purchase Line, Record Purchase Line, Code[20], Code[20]) :
Summary: Integration event raised just before the original purchase line is modified when a new split line is added during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnAddNewPurchaseLineOnBeforeOldPurchaseLineModify(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20]):
Parameters:
OldPurchaseLine: The original purchase line that will be modified to reflect only the already-received quantity.NewPurchaseLine: The newly inserted purchase line carrying the outstanding quantity with the new posting groups.VATProdPostingGroup: The new VAT product posting group code applied to the split line.GenProdPostingGroup: The new general product posting group code applied to the split line.
Remarks: Subscribe to this event to adjust field values on the old or new purchase line before the old line is saved.
OnAddNewSalesLineOnBeforeOldSalesLineModify(Record Sales Line, Record Sales Line, Code[20], Code[20]) :
Summary: Integration event raised just before the original sales line is modified when a new split line is added during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnAddNewSalesLineOnBeforeOldSalesLineModify(var OldSalesLine: Record "Sales Line"; var NewSalesLine: Record "Sales Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20]):
Parameters:
OldSalesLine: The original sales line that will be modified to reflect only the already-shipped quantity.NewSalesLine: The newly inserted sales line carrying the outstanding quantity with the new posting groups.VATProdPostingGroup: The new VAT product posting group code applied to the split line.GenProdPostingGroup: The new general product posting group code applied to the split line.
Remarks: Subscribe to this event to adjust field values on the old or new sales line before the old line is saved.
OnAddNewServiceLineOnBeforeOldServiceLineModify(Record Service Line, Record Service Line, Code[20], Code[20]) :
Summary: Integration event raised just before the original service line is modified when a new split line is added during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnAddNewServiceLineOnBeforeOldServiceLineModify(var OldServiceLine: Record "Service Line"; var NewServiceLine: Record "Service Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20]):
Parameters:
OldServiceLine: The original service line that will be modified to reflect only the already-shipped quantity.NewServiceLine: The newly inserted service line carrying the outstanding quantity with the new posting groups.VATProdPostingGroup: The new VAT product posting group code applied to the split line.GenProdPostingGroup: The new general product posting group code applied to the split line.
Remarks: Subscribe to this event to adjust field values on the old or new service line before the old line is saved.
OnAfterUpdateTables(Record VAT Rate Change Setup) :
Summary: Integration event raised after all standard tables have been processed in the UpdateTables procedure.
[IntegrationEvent(false, false)]
local procedure OnAfterUpdateTables(var VATRateChangeSetup: Record "VAT Rate Change Setup"):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.
Remarks: Subscribe to this event to update additional custom tables that are not covered by the standard conversion logic.
OnAfterConvert(Record VAT Rate Change Setup) :
Summary: Integration event raised after the full VAT rate change conversion process has completed successfully.
[IntegrationEvent(false, false)]
local procedure OnAfterConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup"):
Parameters:
VATRateChangeSetup: The VAT rate change setup record reflecting the completed conversion state.
Remarks: Subscribe to this event to execute post-conversion logic such as sending notifications or updating related records. At this point the setup record has already been marked with the converted date.
OnAfterAreTablesSelected(Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised at the end of AreTablesSelected to allow subscribers to indicate that additional custom tables are configured for conversion.
[IntegrationEvent(false, false)]
local procedure OnAfterAreTablesSelected(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var Result: Boolean):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.Result: Set to true to indicate that at least one custom table is selected for conversion.
Remarks: Subscribe to this event and set Result to true if a custom extension has added tables that should be included in the conversion run.
OnBeforeCheckPurchaseLinePartlyShipped(Record Purchase Line, Text[250], Boolean) :
Summary: Integration event raised before the standard check whether a purchase line has been partially received and is linked to a warehouse document.
[IntegrationEvent(false, false)]
local procedure OnBeforeCheckPurchaseLinePartlyShipped(var PurchaseLine: Record "Purchase Line"; var DescriptionTxt: Text[250]; var IsHandled: Boolean):
Parameters:
PurchaseLine: The purchase line being evaluated.DescriptionTxt: Assign an error description to prevent the line from being converted.IsHandled: Set to true to indicate the event has been handled and skip the standard check.
Remarks: Subscribe to this event to override or extend the partial-shipment check for purchase lines. Assign a non-empty text to DescriptionTxt to block conversion and set IsHandled to true to skip the standard check.
OnBeforeCheckSalesLinePartlyShipped(Record Sales Line, Text[250], Boolean) :
Summary: Integration event raised before the standard check whether a sales line has been partially shipped and is linked to a warehouse document.
[IntegrationEvent(false, false)]
local procedure OnBeforeCheckSalesLinePartlyShipped(var SalesLine: Record "Sales Line"; var DescriptionTxt: Text[250]; var IsHandled: Boolean):
Parameters:
SalesLine: The sales line being evaluated.DescriptionTxt: Assign an error description to prevent the line from being converted.IsHandled: Set to true to indicate the event has been handled and skip the standard check.
Remarks: Subscribe to this event to override or extend the partial-shipment check for sales lines. Assign a non-empty text to DescriptionTxt to block conversion and set IsHandled to true to skip the standard check.
OnBeforeConvert(Record VAT Rate Change Setup) :
Summary: Integration event raised at the beginning of the Convert procedure before any data is processed.
[IntegrationEvent(false, false)]
local procedure OnBeforeConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup"):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.
Remarks: Subscribe to this event to execute pre-conversion validation or setup that must run before the actual conversion starts.
OnBeforeFinishConvert(Record VAT Rate Change Setup) :
Summary: Integration event raised after all records have been converted but before the conversion is marked as completed in the setup record.
[IntegrationEvent(false, false)]
local procedure OnBeforeFinishConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup"):
Parameters:
VATRateChangeSetup: The VAT rate change setup record reflecting the nearly completed conversion state.
Remarks: Subscribe to this event to run final post-processing steps such as recalculating dependent data before the setup record is closed.
OnBeforeOnRun(Boolean) :
Summary: Integration event raised at the start of the OnRun trigger before the conversion is executed.
[IntegrationEvent(false, false)]
local procedure OnBeforeOnRun(var IsHandled: Boolean):
Parameters:
IsHandled: Set to true to indicate the event has been handled and suppress the standard OnRun logic.
Remarks: Subscribe to this event to intercept or replace the standard conversion run. Set IsHandled to true to skip the standard Convert() call.
OnBeforeUpdateGLAccount(Record G/L Account, Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before G/L account records are updated during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateGLAccount(var GLAccount: Record "G/L Account"; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
GLAccount: The G/L account record variable available for pre-processing.VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard G/L account update.
Remarks: Subscribe to this event to replace or extend the standard G/L account update logic. Set IsHandled to true to skip the standard UpdateTable/UpdateRec processing for G/L accounts.
OnBeforeUpdateItem(Record Item, Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before item records are updated during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateItem(var Item: Record "Item"; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
Item: The item record variable available for pre-processing.VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard item update.
Remarks: Subscribe to this event to replace or extend the standard item update logic. Set IsHandled to true to skip the standard UpdateTable/UpdateRec processing for items.
OnBeforeUpdateResource(Record Resource, Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before resource records are updated during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateResource(var Resource: Record "Resource"; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
Resource: The resource record variable available for pre-processing.VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard resource update.
Remarks: Subscribe to this event to replace or extend the standard resource update logic. Set IsHandled to true to skip the standard UpdateTable/UpdateRec processing for resources.
OnBeforeUpdateSales(Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before sales documents are processed during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateSales(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard sales update.
Remarks: Subscribe to this event to replace or extend the standard sales document update logic. Set IsHandled to true to skip the entire standard UpdateSales processing.
OnBeforeUpdateTable(Integer, Boolean, Boolean, Boolean) :
Summary: Integration event raised before a generic table is iterated and updated during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateTable(TableID: Integer; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean; var IsHandled: Boolean):
Parameters:
TableID: The database table ID of the table about to be updated.ConvertVATProdPostingGroup: Indicates whether VAT product posting group codes are to be converted.ConvertGenProdPostingGroup: Indicates whether general product posting group codes are to be converted.IsHandled: Set to true to indicate the event has been handled and skip the standard table update.
Remarks: Subscribe to this event to replace the standard UpdateTable logic for a specific table ID. Set IsHandled to true to skip the standard RecordRef iteration and UpdateRec calls for that table.
OnBeforeUpdatePurchase(Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before purchase documents are processed during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdatePurchase(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard purchase update.
Remarks: Subscribe to this event to replace or extend the standard purchase document update logic. Set IsHandled to true to skip the entire standard UpdatePurchase processing.
OnBeforeUpdateServPriceAdjDetail(Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before service price adjustment detail records are updated during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateServPriceAdjDetail(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard update.
Remarks: Subscribe to this event to replace or extend the standard service price adjustment detail update logic. Set IsHandled to true to skip the standard UpdateServPriceAdjDetail processing.
OnBeforeUpdateService(Record VAT Rate Change Setup, Boolean) :
Summary: Integration event raised before service documents are processed during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateService(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean):
Parameters:
VATRateChangeSetup: The VAT rate change setup record containing the active conversion configuration.IsHandled: Set to true to indicate the event has been handled and skip the standard service update.
Remarks: Subscribe to this event to replace or extend the standard service document update logic. Set IsHandled to true to skip the entire standard UpdateService processing.
OnAfterAddNewSalesLine(Record Sales Line, Record Sales Line) :
Summary: Integration event raised after a new split sales line has been fully inserted during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnAfterAddNewSalesLine(var OldSalesLine: Record "Sales Line"; var NewSalesLine: Record "Sales Line"):
Parameters:
OldSalesLine: The original sales line adjusted to the already-shipped quantity.NewSalesLine: The newly inserted sales line carrying the outstanding quantity with the new posting groups.
Remarks: Subscribe to this event to perform additional processing on the old or new sales line after the split is complete, such as copying custom fields or linked records.
OnAfterAddNewPurchaseLine(Record Purchase Line, Record Purchase Line) :
Summary: Integration event raised after a new split purchase line has been fully inserted during VAT rate change conversion.
[IntegrationEvent(false, false)]
local procedure OnAfterAddNewPurchaseLine(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line"):
Parameters:
OldPurchaseLine: The original purchase line adjusted to the already-received quantity.NewPurchaseLine: The newly inserted purchase line carrying the outstanding quantity with the new posting groups.
Remarks: Subscribe to this event to perform additional processing on the old or new purchase line after the split is complete, such as copying custom fields or linked records.