MultiversExtendedV2 - Create Customer
This document describes the process of creating a new customer in the Multivers ERP system via the App4Sales platform. The process is initiated when a new customer is created in the App4Sales app and submitted to the backend.
Trigger & Permissions
The customer creation process is triggered when a user submits a new customer from the App4Sales application. The functionality is controlled by the CreateCustomer connector information flag, which must be enabled for the connector to accept new customer requests.
Validation & Defaults
Before creating a customer, the system performs several validations and applies default values:
A complete visit address (address line 1, postal code, and city) is mandatory. If any of these fields are missing, the process is aborted with an error message.
If a customer code is provided in the request, the system attempts to update the existing customer. Otherwise, a new customer is created.
When creating a new customer, the connector can be configured to use a template customer from Multivers. The ID of this template is specified in the InsertCustomerTemplate setting.
The connector can be configured to automatically generate a new debtor number based on a defined range. This is enabled with the CreateDebtorNumberOnThePortal setting. The range is determined by the sales representative and the customer's country.
Payload Mapping
The data from the App4Sales customer object is mapped to the Multivers Organisation and Debtor objects. The following tables detail the field mappings.
Organisation
Multivers Field | App4Sales Field | Logic/Notes |
OrganisationName | CustomerName | Direct mapping. |
ChamberOfCommerce | ChamberOfCommerceCode | Direct mapping. If the source is null, it is set to an empty string. |
LanguageId | LanguageCode | The App4Sales language code is mapped to the corresponding Multivers language ID. |
CountryId | CountryCode | The App4Sales country code is mapped to the corresponding Multivers country ID. |
SearchName | CustomerName | The first 6 characters of the customer name. |
Debtor
Multivers Field | App4Sales Field | Logic/Notes |
DebtorId | CustomerCode | If `CreateDebtorNumberOnThePortal` is enabled, a new debtor ID is generated. Otherwise, this is mapped from the customer code if it exists, or it remains null for the ERP to assign. |
VatScenario | - | Determined based on VAT scenario codes configured in the settings. |
VatNumber | VatCode | If `VatCode` is empty, it is set to "In aanvraag". |
VatType | VatLiable | Mapped to "J" for true and "N" for false, but can be overridden by VAT scenario logic. |
TermsOfPayment | PaymentCondition | Direct mapping, but can be overridden by customer range settings. |
TermsOfDelivery | - | Set from the `TermsOfDelivery` setting, with "DD1" as a fallback. |
PriceList | UsesPrice | The price list ID is looked up and the corresponding code is used. If `RetrieveMultipleCurrencyPricelists` is enabled, the currency is also considered. |
CurrencyCode | UsesPrice / CustomerRange | Can be derived from a currency-specific price list or from the customer range settings when a new debtor number is generated. |
RepresentativeId | Username / Representative (from UnknownElements) | If `CreateDebtorNumberOnThePortal` is enabled, this is determined by whether the request is from Portal4Sales or based on the 'Representative' field in the request. For existing customers, it's looked up from the database. |
AccountReference | - | Determined by VAT scenario logic, but can be overridden by customer range settings if `GetAccountReferenceFromCustomerRange` is enabled. |
EdiSalesorders | - | Hardcoded to `true`. |
Addresses and Contacts
Multivers Field | App4Sales Field | Logic/Notes |
Person.FirstName | ContactFullName | The first name is extracted from the full name. |
Person.PersonName | ContactFullName | The last name is extracted from the full name. |
Person.Initials | ContactFullName | Initials are extracted from the full name. |
Address.AddressLine1 | VisitAddress1 / DeliveryAddress1 | The street name is extracted from the address line. |
Address.AddressLine2 | VisitPostCode, VisitCity / DeliveryPostCode, DeliveryCity | A combination of postal code and city. |
Address.AddressFormatNo | VisitAddress1 / DeliveryAddress1 | The house number is extracted from the address line. |
Address.AddressFormatCity | VisitCity / DeliveryCity | Direct mapping. |
Address.AddressFormatPostalcode | VisitPostCode / DeliveryPostCode | Direct mapping. |
Address.CountryId | CountryCode | The App4Sales country code is mapped to the corresponding Multivers country ID. |
Address.AddressType | - | "X" for the visit/main address and "A" for the delivery address. |
Telecom.TelecomNo | Phone, Fax, Email, Mobile, OrderConfirmationEmail, InvoiceEmail | Multiple telecom entries are created for different types of contact information. |
Response & Error Handling
After the request is sent to Multivers, the connector processes the response. If the creation is successful, Multivers returns the new debtor ID, which is then sent back to the App4Sales app. If an error occurs, the error message from Multivers is captured and returned to the user. The connector checks for error messages in the response from the `MaintainDebtor` call and will return a descriptive error if one is found.
Related Settings & Prerequisites
InsertCustomerTemplate: The ID of the customer in Multivers to be used as a template for new customers.