Webshop Data Mapping
Applies to: Sana Commerce Cloud 10.0.17 and higher in Microsoft Dynamics 365 Business Central.
Using the Webshop Data Mapping window, you can map fields and save certain values to the specified fields.
In Microsoft Dynamics 365 Business Central click on the search button and enter Webshops. Select your webshop and click: Related > Webshop > Webshop Data Mapping.
The data mapping can be used for the order and quotation creation, online customer registration and presentation of a prospect by a sales agent. Whether a customer places an order or a quotation, or a customer registers online in the Sana webshop, or a sales agent creates a prospect in the Sana webshop, the necessary data is saved to the relevant tables in Dynamics 365 Business Central.
In the Webshop Data Mapping window, you firstly need to select the necessary table to create a rule. The available options are:
-
Customer: Select this option if you need to create rules for the fields from the customer table.
-
Sales Header: Select this option if you need to create rules for the fields from the sales order or sales quote header table.
-
Sales Line: Select this option if you need to create rules for the fields from the sales order or sales quote line table.
-
Ship-to Address: Select this option if you need to create rules for the fields from the ship-to address table.
-
Contact: Select this option if you need to create rules for the fields from the contact table.
When the table is selected, you can create a rule for any field from this table or you can create a mapping between the fields from this table. Also, you can create a mapping between the sales document header and lines and copy or move field values between these two tables.
You can set the priority of the webshop data mapping rules and copy the rules from one webshop to another webshop starting from Sana Commerce Cloud 10.0.38 in Microsoft Dynamics 365 Business Central.
You can disable validation for the fields, copy field values and disable rules starting from Sana Commerce Cloud 10.0.75 in Microsoft Dynamics 365 Business Central.
You can set the order in which rules should be executed using the Priority field and the Increase Priority and Decrease Priority buttons. The priority is crucial if you combine several rules and create more complicated scenarios. In this case, the rules should be executed in a specific order.
If you have several webshops, you can import the webshop data mapping rules from one webshop to another. To do this, open the webshop to which you need to import rules and in the Webshop Data Mapping window, click Import Rules. Then, in the Webshop Id, select the webshop from which you want to import rules and click Import.
Using the Disable Validation checkbox, you can disable system validation for a certain field. By default, validation is enabled. You should disable it only if you are sure of what you are doing.
Using the Duplicate checkbox, you can copy field values. When you create the field mapping and the Duplicate checkbox is selected, the same values will be available in both fields.
Using the Disable checkbox, you can disable any existing webshop data mapping rule without deleting it. If the webshop data mapping rule is disabled, it will not work in your webshop.
We strongly recommend to check the following points before creating any rules:
-
Use only the fields you are familiar with to create rules. If you are going to use some unknown field, try to find out its purpose firstly before creating a rule. Make sure that the created rule works correctly, otherwise it can cause problems in the work of Dynamics 365 Business Central.
-
When you create data mapping rules, take into consideration the priority of the fields. If you set the default value for the Sana field using the Default Value field, the default value will be saved to the Sana field only if it is coming empty from the Sana webshop. If the Sana field has a value, the default value from the data mapping rule will be ignored. In case, you created a mapping, for example, between two Sana fields, the value will be passed to the mapped field in any case. If the mapped Sana field has its own value, it will be ignored. Unlike the rules with default value, the rules which you create to map two fields have higher priority, that is why if the mapped field has some value in Sana, it will be ignored.
In the previous version, which is Sana Commerce Cloud 10.0.17 in Microsoft Dynamics 365 Business Central, the data mapping rules worked in the following way: when a rule was created using the Default Value field, the default value overrode any other values coming from Sana.
Starting from Sana Commerce Cloud 10.0.24 in Microsoft Dynamics 365 Business Central, the Default Value field works differently. Now, if some values are coming from Sana, then they will be saved to the relevant fields in Microsoft Dynamics 365 Business Central, the default value set in the rule will be ignored. The default value from the created data mapping rule is used only in case if no values are coming from Sana.
In the previous versions, when you created a mapping between two fields, for example, Field 1 (a field which passes the value) and Field 2 (a field which receives the value), the value of the Field 1 was copied to the Field 2 and Field 1 kept its value, meaning that in Dynamics 365 Business Central both fields had the same value.
Starting from Sana Commerce Cloud 10.0.30 in Microsoft Dynamics 365 Business Central, the mapping between two fields works differently. Field 1 passes its value to Field 2 and Field 2 is saved to Dynamics 365 Business Central with this value, while Field 1 will remain empty in Dynamics 365 Business Central.
How to Use Webshop Data Mapping?
Data mapping rules can be configured differently and can serve different purposes. There are 5 main scenarios presented below which show how data mapping can be used. You can use data mapping for the cases we described or for some other cases to fit your business needs.
Scenario 1
There might be some field that you do not use in the Sana webshop, but you need to copy some data to this field from the field that you use in the Sana webshop.
For example, in the customer registration form in the Sana webshop there is the Address field where a customer needs to enter the address. The Address 2 field is not available in the customer registration form, but you need the value from the Address field to be copied to the Address 2 field.
To do this, in the Webshop Data Mapping window you can create a mapping between a field that is used in the Sana webshop, in this case it is Address, and a field that is not used in the Sana webshop, which is Address 2.
If you create a mapping between fields, the value of the field specified in Mapped Field Name will be passed to the field specified in Target Field Name. If you do not need the field specified in Mapped Field Name to keep its value, make sure that the Duplicate checkbox is disabled. See the screenshot below.
If such a rule is created, then when a customer enters the address in the Address field during registration in the Sana webshop, the value from the Address field will be copied and saved to the Address 2 field in the customer table in Dynamics 365 Business Central. The Address field will be blank.
In case the field specified in Mapped Field Name has no value, the field specified in Target Field Name will be saved to Dynamics 365 Business Central with no value as well.
For example, you have mapped the fields Address and Address 2. Both of these fields are available on the customer registration form in the Sana webshop. The Address field should pass its value to the Address 2 field. If a customer during registration fills in the Address 2 field, but leaves the field Address empty, the Address 2 field will be saved in the customer table in Dynamics 365 Business Central with no value.
The data mapping rules in which you create a mapping between two fields has higher priority. That is why, for example, if the mapped field is the Sana field and it has value in the Sana webshop, this value will be ignored. The value of the Sana field will change according to the rule set in the Webshop Data Mapping window.
If you map the fields, the value of the field specified in Mapped Field Name will be always passed to the field specified in Target Field Name. Check the following cases:
If the Duplicate checkbox is enabled, the field specified in Mapped Field Name will keep its value.
Case 1
Mapped Field Name: field has value
Target Field Name: field has no value
The Duplicate checkbox is disabled
Result: the value of the field specified in Mapped Field Name is passed to the field specified in Target Field Name. The field specified in Mapped Field Name remains empty.
Case 2
Mapped Field Name: field has value
Target Field Name: field has value
The Duplicate checkbox is disabled
Result: the value of the field specified in Mapped Field Name is passed to the field specified in Target Field Name overriding the value of the mapped field. The field specified in Mapped Field Name remains empty.
Case 3
Mapped Field Name: field has no value
Target Field Name: field has value
Result: the field specified in Target Field Name becomes empty.
Scenario 2
You may have created some custom fields in Dynamics 365 Business Central which Sana does not use, but you need to save some sales order data to these custom fields. In the Webshop Data Mapping window it is possible to create a rule where you can specify a value for a custom field. See the screenshot below.
If such a rule is created, then when a customer places an order in the San webshop, the custom field will be always shown in the sales order table in Dynamics 365 Business Central with the value you set for this field in the Webshop Data Mapping window.
Scenario 3
There are some standard fields in Dynamics 365 Business Central which are not used by Sana.
You can save some values to these fields, if necessary. For example, the field Order Class in the sales order table is not used by Sana and it is always empty. In the Webshop Data Mapping window it is possible to create a rule where you can specify a value for a certain field. See the screenshot below.
If such a rule is created, the value SC (Sana Commerce orders) will be saved to the Order Class field in the sales order table for all sales orders placed from the Sana webshop.
Scenario 4
You can even combine different rules and create more complicated scenarios.
As mentioned before, if you map two fields, the field specified in Mapped Field Name will always pass its value to the field specified in Target Field Name and the field in Mapped Field Name will remain empty or will keep its value depending on whether the Duplicate checkbox is selected or not. You can configure data mapping in such a way, that the field specified in Mapped Field Name will pass its value to the field specified in Target Field Name and then some value will be saved in the field which passed its value. See the screenshot below.
If you create several interrelated rules, it is important to specify the order in which they will be executed. You can set the order of rules using the Priority field and the Increase Priority and Decrease Priority buttons. For such scenario the Duplicate checkbox should be disabled.
In this case, in the first rule the field Invoice Disc. Code is mapped to the field External Document No. and the priority of the rule is set to 1. In the second rule the default value 800336467998 is set for the field External Document No. and the priority of the rule is set to 2.
If such two rules are created, then the first rule will be executed, according to this rule the value of the field External Document No. will be passed to the mapped field Invoice Disc. Code. For example, a customer places an order in the Sana webshop and enters the value 90036985298 in the Reference no. field. The Reference no. field in the Sana webshop is the External Document No. field in Dynamics 365 Business Central. The value 90036985298 will be saved to the Invoice Disc. Code field in Dynamics 365 Business Central.
Then, the second rule will be executed, according to this rule the value 800336467998 will be saved to the External Document No. field.
As a result, both fields will be saved in the sales header table in Dynamics 365 Business Central with values. The External Document No. field will be saved with the value 800336467998 and the Invoice Disc. Code field with the value 90036985298.
Scenario 5
If necessary, you can copy or move the value of the field from the sales header table to another field from the sales line table.
For example, when customers place an order in the Sana webshop, they can enter the reference number on the Order Overview checkout step. By default, the reference number is saved to the External Document No. Sana field in the sales header table in Dynamics 365 Business Central. Let’s say you want to save the reference number to a different field in the sales order lines instead of sales order header.
It is possible to create a rule where you can specify to which field in which table the value should be moved. See the screenshot below.
If such a rule is created, then when a customer enters the reference number while placing an order in the Sana webshop, the reference number will be moved from the External Document No. field in the sales order header to the Description field in the sales order lines in Dynamics 365 Business Central.
If the Duplicate checkbox is enabled, the External Document No. field will keep its value. If the Duplicate checkbox is disabled, then the the External Document No. field will pass its value to the Description field and will remain empty.
Disable Webshop Data Mapping
Applies to: Sana Commerce Cloud 10.0.38 and higher in Microsoft Dynamics 365 Business Central.
If you do not want the webshop data mapping rules to be applied to your webshop, you can disable them globally in the webshop settings on the Optimization FastTab. If you activate the Disable Data Mapping option, then webshop data mapping rules configured in Dynamics 365 Business Central will not be applied to your webshop.
For more information, see Optimization.