The message is the carrier for all the information that is needed for the integration. On the message record mapping, you define for each target document record the mapped source document record.


Application Consultant Application Consultant Start Start Set up record mapping Set up record mapping On the message record mapping, define for each target document record the mapped source document record. Procedure 1. Click Connectivity studio Integration Design. 2. On the Message tab, in the list, find and select the desired message. 3. Click Edit. 4. In the Mapping section, click Add line. 5. In the Target record field, enter or select a value. 6. In the Source record field, enter or select a value. 7. Select Yes in the External reference field. 8. Define what must be done to the target record on import to D365 FO. Existing records are found based on the key fields as defined in the field mapping. You can choose from these record actions: - Update or insert: If the record exists, it is updated. If the record does not exist, it is inserted. - Delete: If the record exists, it is deleted. Note: This option is not used often because it is often not allowed to delete data in an ERP application. - Replace: If the record exists, it is first deleted and then inserted again based on the source data. You can, for example, use this for updated orders, if you do not know which lines are deleted. - Find: Only finds the record, which can be used as source record in a field mapping of a next record mapping. - Insert: Always inserts the record, whether it exists or not. - Update: Updates a record if it exists. If the record does not exist, it fails. - Insert or fail: Inserts a record. If the record already exists, is fails. In the Record action field, select an option. Note: You can also use this to export to an external database. So, the target document is of type ODBC. In this case, only choose from these record actions: - Update or insert - Insert - Delete 9. In the Condition field, select an option. 10. In the Execute field, select an option. 11. Close the page. Define record mapping sequence Define record mapping sequence You can change the sequence of the record mappings to make sure the related data is exchanged in the right order. Procedure 1. Click Connectivity studio Integration Design. 2. On the Message tab in the list, find and select the desired message. 3. Click Edit. 4. In the Mapping section, in the Target record pane, find and select the desired record. 5. Click Move up. 6. In the Mapping section, in the Target record pane, find and select the desired record. 7. Click Move down. 8. Close the page. What type of  condition must  be applied? What type of  condition must  be applied? Set up mapping conditions Set up mapping conditions Sometimes, you want to skip a record mapping when running a message. You can use conditions to indicate if the record mapping must be applied. The record mapping is only applied if the conditions are met. You can set up several conditions for each record mapping.Examples of values that you can use to define a condition:..Item1 Item1 and smallerItem1.. Item1 and greaterItem1,item5..item10 Item1 or item5 till item10Item1,item2 Item1 or item2!123 Not 123“” Empty!”” Not emptycurExt() Used to apply a condition with the current company Procedure 1. Click Connectivity studio Integration Design. 2. On the Message tab, in the list, find and select the desired message. 3. Click Edit. 4. In the Mapping section, in the Target record list, find and select the desired record. 5. In the Condition field, select 'Yes'. 6. Click the Mapping Condition tab. 7. In the Record origin field, select an option. 8. In the Record field, enter or select a value. 9. In the Record field field, enter or select a value. 10. In the Value field, type a value. 11. Sub-task: Set additional conditions. 12. Click New. 13. In the Record origin field, select an option. 14. In the Record field, enter or select a value. 15. In the Record field field, enter or select a value. 16. In the Value field, type a value. 17. Close the page. Notes Applying conditions can influence the message performance. So, only apply a condition if required and keep it as simple as possible. Set up mapping condition using an expression Set up mapping condition using an expression Sometimes, you want to skip a record mapping when running a message. You can use a condition that is defined as an expression to indicate if the record mapping must be applied. The record mapping is only applied if the expression condition is met.You define an expression with self-defined variables. Variables must be linked to fields from the source document or the target document.Example:Expression: Price>AmountCondition value: IF(Price>Amount, true, false)Variables:Price is linked to SalesPrice field of the SalesLine source record.Amount is linked to LineAmount field of the SalesLine source record.The record mapping is only applied if the sales price is higher than the line amount.For more information on expressions, refer to: Expression. Procedure 1. Click Connectivity studio Integration Design. 2. On the Message tab, in the list, find and select the desired message. 3. Click Edit. 4. In the Mapping section, in the Target record pane, find and select the desired record. 5. In the Condition field, select 'Expression'. 6. Click the Mapping Condition tab. 7. In the Expression field, enter the expression, using variables. 8. Select Yes in the Invert condition field. 9. Sub-task: Define variables. 10. Click New. 11. In the Variable field, type exactly the variable name as used in the expression. 12. In the Record origin field, select an option. 13. In the Record field, enter or select a value. 14. Define the document record field to which the variable is linked. In the Record field field, enter or select a value. Note: The field type, as defined for the document record field, is shown as well. 15. In the Variable type field, select an option. 16. In the Language field, type a value. Notes Applying expression conditions can influence the message performance. So, only apply an expression condition if required and keep it as simple as possible.Some examples of a more complex condition expression. Note that both an 'AND' and 'OR' statement are used.Example 1: Based on the values of 'role', 'email', and 'invoiceId', the record mapping is done or not.Example 2: Based on the values of the 'email' and 'invoiceId', the record mapping is done or not. Specific query  settings needed? Specific query  settings needed? Define record mapping query settings Define record mapping query settings When you run a message, a query is applied. For this query, you can define several specific settings: Cross company: If you run a message, the query is done in the company where you started the message. However, sometimes, for a specific record, it can be required to read data from another company. For example, if you run a message for a purchase order, you can read the data of a related sales order in another company. Time validation: If some record is valid for a specific time period, by default, the time validation uses the currently valid record. You can disable the time validation. As a result, the first available record is used. Which doesn't need to be the currently valid record. For example, addresses are valid during a specified time period. If time validation is applied, the currently valid address is used. If time validation is disabled, the address is used with the first time period. Procedure 1. Click Connectivity studio Integration Design. 2. On the Message tab, in the list, click the link in the desired message. 3. In the Mapping section, in the Target record list, find and select the desired record. 4. Click the Query tab. 5. Sub-task: Define cross company settings. 6. You can define if the query is applied: - Only to the company from which the message is run. Select No. - Cross company. Select Yes. In the Cross company field, select the desired option. Note: Only use the cross company option to read data from other companies than the current company. Not to set or change data in other companies. 7. In the Company range field, enter or select a value. 8. Sub-task: Define time validation settings. 9. Select Yes in the Disable time validation field. 10. Close the page. End End Condition Expression No Yes No

Activities

Name Responsible Description

Set up record mapping

Application Consultant

On the message record mapping, define for each target document record the mapped source document record.

Define record mapping sequence

Application Consultant

You can change the sequence of the record mappings to make sure the related data is exchanged in the right order.

Set up mapping conditions

Application Consultant

Sometimes, you want to skip a record mapping when running a message. You can use conditions to indicate if the record mapping must be applied. The record mapping is only applied if the conditions are met. You can set up several conditions for each record mapping.
Examples of values that you can use to define a condition:
  • ..Item1 Item1 and smaller
  • Item1.. Item1 and greater
  • Item1,item5..item10 Item1 or item5 till item10
  • Item1,item2 Item1 or item2
  • !123 Not 123
  • “” Empty
  • !”” Not empty
  • curExt() Used to apply a condition with the current company

Set up mapping condition using an expression

Application Consultant

Sometimes, you want to skip a record mapping when running a message. You can use a condition that is defined as an expression to indicate if the record mapping must be applied. The record mapping is only applied if the expression condition is met.
You define an expression with self-defined variables. Variables must be linked to fields from the source document or the target document.
Example:
Expression: Price>Amount
Condition value: IF(Price>Amount, true, false)
Variables:
  • Price is linked to SalesPrice field of the SalesLine source record.
  • Amount is linked to LineAmount field of the SalesLine source record.
The record mapping is only applied if the sales price is higher than the line amount.
For more information on expressions, refer to: Expression.

Define record mapping query settings

Application Consultant

When you run a message, a query is applied. For this query, you can define several specific settings:

  • Cross company:
    If you run a message, the query is done in the company where you started the message. However, sometimes, for a specific record, it can be required to read data from another company. For example, if you run a message for a purchase order, you can read the data of a related sales order in another company.
  • Time validation:
    If some record is valid for a specific time period, by default, the time validation uses the currently valid record. You can disable the time validation. As a result, the first available record is used. Which doesn't need to be the currently valid record. For example, addresses are valid during a specified time period. If time validation is applied, the currently valid address is used. If time validation is disabled, the address is used with the first time period.

See also

Provide feedback