Multivers Extended V3 - Create Customer
This document describes the process of creating a new customer in the Multivers ERP system via App4Sales. The process is initiated when a new customer is created in the App4Sales app and submitted to the backend.
Trigger & Permissions
The creation of a customer is triggered when a user with the appropriate permissions creates a new customer in the App4Sales mobile application. The connector must have the 'CreateCustomer' and 'EditCustomer' flags enabled in the connector info settings.
Payload Mapping
The following tables describe the mapping of fields from the App4Sales customer model to the Multivers ERP system. The process involves creating an 'Organisation', one or more 'Persons' (contacts), and a 'Debtor' record.
Organisation
Multivers Field | App4Sales Field | Logic/Notes |
Name | CustomerName | Direct mapping. |
LanguageCode | LanguageCode | Direct mapping. |
SearchName | CustomerName | The customer's name, truncated to the first 6 characters. |
Emails | Email, EmailAddressForStock | A list of emails is created from the customer's primary email and stock email address. The 'TeleComUsedTypeEmail' setting can be used to specify a telecom usage code. |
CocNumber | ChamberOfCommerceCode | Direct mapping. |
TelephoneNumbers | Phone, Fax, ContactPersons.MobileNumber | A list of phone numbers is created from the customer's phone, fax, and mobile numbers of contact persons. The 'TeleComUsedTypeTelephone' setting can be used to specify a telecom usage code. |
Addresses | Addresses | The customer's addresses are mapped to Multivers organisation addresses. |
OrganisationCode | CustomerCode | If 'CreateDebtorNumberOnThePortal' setting is true, a random 8-character alphanumeric string is generated. Otherwise, the CustomerCode from App4Sales is used. |
Person (Contact)
Multivers Field | App4Sales Field | Logic/Notes |
FirstName | FirstName | Direct mapping. |
LastName | LastName | Direct mapping. |
FullName | FullName | Direct mapping. |
LanguageCode | LanguageCode | Direct mapping. |
Gender | Gender | The gender is mapped. 'F' is converted to 'V' for "Vrouw" (Female). |
Initials | Initials | Direct mapping. |
Name | FullName | Direct mapping. |
PersonCode | ContactId | If 'CreateDebtorNumberOnThePortal' setting is true, a random 8-character alphanumeric string is generated. Otherwise, the ContactId from App4Sales is used. |
EmailAddresses | The contact person's email address. | |
TelephoneNumbers | Phonenumber, MobileNumber | The contact person's phone and mobile numbers. |
CountryCode | Addresses.Iso2 | The ISO2 country code of the customer's primary address. |
PrefixTitle | Function | The first part of the 'Function' field, split by a space. |
SuffixTitle | Function | The second part of the 'Function' field, split by a space. |
Debtor
Multivers Field | App4Sales Field | Logic/Notes |
IsActive | - | Hardcoded to 'true'. |
OrganisationCode | - | The code of the newly created organisation. |
DebtorCode | CustomerCode | The customer code from App4Sales, or a newly generated code if 'CreateDebtorNumberOnThePortal' is enabled. |
ContactPersonCode | MainContactPerson.ContactId | The ID of the main contact person. |
VatNumber | VatCode | Direct mapping. |
PaymentConditionCode | PaymentConditionCode | Direct mapping. |
CurrencyCode | Currency | Direct mapping. |
PriceListCode | UsesPriceField | The code of the price list associated with the customer. |
VatScenarioCode | - | Determined based on the customer's country and connector settings. |
CalculateVat | VatLiable | Based on the 'VatLiable' field. |
AccountReferenceCode | - | Uses the 'DefaultAccountReference' setting, or the account reference from the VAT scenario. |
DeliveryAddressCode | - | The ID of the customer's delivery address. |
VisitorsAddressCode | - | The ID of the customer's visiting address. |
PostalAddressCode | - | The ID of the customer's postal address. |
AddressPriorityCode | - | The ID of the customer's general address. |
InvoiceTypeCode | - | Hardcoded to '0'. |
RepresentativeCode | - | The sales representative ID, retrieved from the 'Representative' or 'Vertegenwoordiger' unknown element, or from the current user's context. |
DeliveryConditionCode | - | The 'DefaultDeliveryConditionCode' setting. |
Validation & Defaults
Before a customer can be created, a template debtor and organisation must be configured in the connector settings ('InsertCustomerTemplate'). If these templates are not found, the process will fail. The system also validates the VAT scenario based on the customer's country and connector settings. If the required VAT scenario is not found, the process will fail.
Response & Error Handling
After the customer is created in Multivers, the new customer ID is returned and stored in the App4Sales database. If any step in the creation process fails, an exception is thrown and logged. The user will receive an error message in the App4Sales application.
Related Settings & Prerequisites
The following connector settings are relevant for the customer creation process:
InsertCustomerTemplate: The code of the template debtor to use when creating new customers.
CreateDebtorNumberOnThePortal: If enabled, the connector will generate a new debtor number based on a predefined range.
HomeCountry: The home country of the company.
VatScenarioCodeHomeCountry: The VAT scenario code for customers in the home country.
VatScenarioCodeEU: The VAT scenario code for customers in other EU countries.
VatScenarioCodeOutsideEU: The VAT scenario code for customers outside the EU.
DefaultDeliveryConditionCode: The default delivery condition code for new customers.
DefaultAccountReference: The default account reference for new customers.
TeleComUsedTypeEmail: The telecom usage code for email addresses.
TeleComUsedTypeTelephone: The telecom usage code for telephone numbers.