--- title: "Apply external code (Field option)" slug: "apply-external-code-field-option" tags: ["Task topic"] updated: 2026-03-20T08:03:51Z published: 2026-03-20T17:44:14Z canonical: "docs.staedean.com/apply-external-code-field-option" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Apply external code (Field option) In a field mapping, you can apply an external code as defined for the related entity. As a result, on: - Import, the external code is replaced with the related code in your D365 F&SCM environment. - Export, the code in your D365 F&SCM environment is replaced with the related external code. You can only use the external code setup in messages that are run in EDI Studio. To use the external code functionality, in EDI Studio, additional external code setup is required for the EDI parties or EDI groups. For each EDI party or EDI group, you can define an external code definition as set up for a: - Currency - Released product - Charge codes of miscellaneous charges - Modes of delivery - Terms of delivery - Unit ### Steps 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, in the list, find and select the desired target record. 5. On the **Mapping** tab, on the **Field mapping** tab, in the list, find and select the desired field mapping. 6. Click the **Field options** tab. 7. Select the **External code** check box. 8. Define the desired external code definition setup table. So, the table for which the external code is defined. **Example:** On export of a purchase line, you want to replace an item ID with an external code. The external code is not defined for the item ID in the PurchLine table but for the Item ID in the InventTable. So, select the InventTable as external code value table. In the **External code value table name** field, enter or select a value. 9. Define the desired external code definition setup table field. So, the table field for which the external code is defined. **Example:** In the example of the previous step, select the ItemId field of the InventTable as external code value field. In the **External code value field name** field, enter or select a value. 10. For the setup, as defined in the two previous steps, define the applicable external code definition, as defined by the applicable EDI party or EDI group. In the BisEdiHistory table, several external code fields are defined that are related to the external code setup for EDI parties or EDI groups. Select the desired table, usually the BisEdiHistory table, to indicate which external code is applicable. In the **External code source record** field, enter or select a value. 11. Select the desired table field, usually an external code field of the BisEdiHistory table, to indicate which external code definition is applicable. In the **External code source field** field, enter or select a value. 12. Close the page.