Codeunit 18008310 EOS010 Salesp. Import Mgmt.
Codeunit 18008310 EOS010 Salesp. Import Mgmt.
Codeunit for managing the import of salesperson data into Business Central. This codeunit handles the complete import process including:
- Validating imported salesperson records
- Applying salesperson assignments to various sales documents and master data
- Performing data quality checks after import
- Managing status updates for imported records Supports import for: Customer, Ship-to Address, Sales Header, Sales Line, Sales Invoice Header/Line, Sales Credit Memo Header/Line, and archived documents.
Methods
CheckImport
procedure CheckImport()
Validates all salesperson import records. Iterates through all records in the “EOS010 Salesperson Import” table and checks each line for validity. Records with errors are marked with Status::Error.
CheckImport
procedure CheckImport(var SalespersonImport: Record "EOS010 Salesperson Import")
Validates a filtered set of salesperson import records. Iterates through the provided record set and validates each import line. Invalid records are marked with Status::Error and an error message. Valid records are updated with Status::Valid.
Parameters / Return Value
SalespersonImport
Record "EOS010 Salesperson Import"The filtered record set to validate. Filters applied before calling will be respected.
ApplyImport
procedure ApplyImport()
Applies all validated salesperson import records to the target tables. This procedure:
- Checks any unchecked records first
- Validates that no error records exist
- Applies salesperson assignments to Customer, Ship-to Address, Sales documents, etc.
- Performs a data quality check after import
- Updates record status to Imported User confirmation is required before execution.
UpdateSourceRecord
procedure UpdateSourceRecord(var CurrentSalesP: Record "EOS010 Salesperson Import"; var CurrentSalesPDict: Dictionary of [Code[10], Code[20]])
Updates the source record (Customer, Sales Header, etc.) with the salesperson assignments. Based on the Table No. field, retrieves the appropriate record and calls EOS010SetSalesPersons. Also updates the primary Salesperson Code if configured in Commission Setup. Raises events before each table update to allow customization or handling of custom tables.
Parameters / Return Value
CurrentSalesP
Record "EOS010 Salesperson Import"The import record containing the source record reference.
CurrentSalesPDict
Dictionary[Code,Code]Dictionary mapping Salesperson Role codes to Salesperson codes.
CreateDummyDocuments
procedure CreateDummyDocuments()
Creates dummy documents for testing purposes. WARNING: This procedure is intended for development/testing only and should NOT be executed in production. Creates placeholder records for Customer, Ship-to Address, Sales Header, Sales Line, Sales Invoice Header/Line, and Sales Credit Memo Header/Line based on import data. User confirmation is required before execution.
ConvertIntegerListToFilter
procedure ConvertIntegerListToFilter(IntegerList: List of [Integer]; var Filters: List of [Text])
Converts a list of integers into a Business Central compatible filter string. Creates range expressions (e.g., “1..5”) for consecutive numbers and individual values for isolated numbers. Assumes the input list is already sorted from lowest to highest value.
Parameters / Return Value
IntegerList
List[Integer]Sorted list of integers to convert to filter string
Filters
List[Text]
Events
OnUnknowTableUpdate
local procedure OnUnknowTableUpdate(CurrentSalesP: Record "EOS010 Salesperson Import"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised for unknown (custom) tables while converting old “EOS Add. Salesperson/Purchaser” record table You must handle all unknow tables references to proceed with the upgrade.
Parameters / Return Value
CurrentSalesP
Record "EOS010 Salesperson Import"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
Boolean
OnBeforeUpdateCustomer
local procedure OnBeforeUpdateCustomer(var Customer: Record Customer; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
Customer
Record "Customer"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateShipToAddress
local procedure OnBeforeUpdateShipToAddress(var ShipToAddress: Record "Ship-to Address"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
ShipToAddress
Record "Ship-to Address"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesHeader
local procedure OnBeforeUpdateSalesHeader(var SalesHeader: Record "Sales Header"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesHeader
Record "Sales Header"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesLine
local procedure OnBeforeUpdateSalesLine(var SalesLine: Record "Sales Line"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesLine
Record "Sales Line"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesInvoiceHeader
local procedure OnBeforeUpdateSalesInvoiceHeader(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesInvoiceHeader
Record "Sales Invoice Header"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesInvoiceLine
local procedure OnBeforeUpdateSalesInvoiceLine(var SalesInvoiceLine: Record "Sales Invoice Line"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesInvoiceLine
Record "Sales Invoice Line"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesCreditMemoHeader
local procedure OnBeforeUpdateSalesCreditMemoHeader(var SalesCreditMemoHeader: Record "Sales Cr.Memo Header"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesCreditMemoHeader
Record "Sales Cr.Memo Header"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
BooleanReturn true if you take full responsibility for updating the ‘EOS Salesperson Set ID’ with the value of SalespersonSetID
OnBeforeUpdateSalesCreditMemoLine
local procedure OnBeforeUpdateSalesCreditMemoLine(var SalesCreditMemoLine: Record "Sales Cr.Memo Line"; var SalesPersonDict: Dictionary of [Code[10], Code[20]]; var IsHandled: Boolean)
Raised before “Get” method. Use this event for “AddLoadFields()” if you encounter “jit” problems.
Parameters / Return Value
SalesCreditMemoLine
Record "Sales Cr.Memo Line"SalesPersonDict
Dictionary[Code,Code]Dictionary of Role/Salespersons
IsHandled
Booleanreturn true if you handle the “EOS Salesperson Set ID” field update
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.