Create NetSuite Sales Orders from Dynamics 365 Opportunities > Introduction to Create Netsuite Sales Orders from Dynamics 365 Opportunities recipe > Prerequisites
  

Prerequisites

To create a NetSuite sales order from a Dynamics 365 opportunity, the following prerequisites must be met:

Creating a custom field in the NetSuite sales order entity

Create a Dynamics ID custom field in the NetSuite sales order entity.
  1. 1Log in to the NetSuite organization.
  2. 2Go to Customization > Lists, Records, & Fields > Transaction Body Fields > New.
  3. The following image shows the Transaction Body Field page:
    The image shows the Transaction Body Field page.
  4. 3On the Transaction Body Field page, enter the value as Dynamics ID in the LABEL field and custbodycustentitydynamics_id in the ID field.
  5. 4Select SALE in the Applies To tab as shown in the following image:
  6. The image shows the fields to configure on the Transaction Body Fields page.
    These values are used for searching the matching sales order.
  7. 5Click Save.

Creating a custom field in Dynamics 365 account entity

Create a new_netsiteid custom field in the Dynamics 365 account entity.
  1. 1Log in to the Dynamics 365 organization.
  2. 2Go to Settings > Advanced Settings.
  3. The following image shows the Advanced Settings option on the Dynamics 365 page:
    The image shows the Advanced Settings option on the Dynamics 365 page.
  4. 3On the Settings page, click Customizations.
  5. The following image shows the Customizations option on the Settings page:
    The image shows the Customizations option on the Settings page.
  6. 4Click Customize the System.
  7. The following image shows the Customize the System option on the Customization page:
    The image shows the Customize the System on the Customization page.
  8. 5Go to Components > Entities > Account > Fields, and then click New.
  9. The following image shows the New button on the Account Fields page:
    The image shows the New button on the Account Fields page.
  10. 6In the Display Name field, enter the value as NetSuite ID and click Save and Close.
  11. The value in the Name field is automatically set to new_netsuiteid.
    The following image shows the New for Account page:
    The image shows the New for Account page.

Creating a webhook in Dynamics 365

Webhooks are a way to communicate when an event occurs in one system with another system.
You can create webhooks in various ways. In this recipe, we have used the Plug-in Registration Tool.
Use the Plug-in Registration Tool to register a webhook. To get the Plug-in Registration Tool, see Dataverse development tools.
To create a webhook in Dynamics 365, perform the following steps:
  1. 1Open the Plug-in Registration Tool and log in to your organization.
  2. 2Click CREATE NEW CONNECTION on the Plugin Registration Tool page.
  3. The following image shows the CREATE NEW CONNECTION button on the Plugin Registration Tool page:
    The image shows the CREATE NEW CONNECTION button on the Plugin Registration Tool page.
  4. 3Go to Register and select Register New Web Hook.
  5. The following image shows the Register New Web Hook option on the Register menu:
    The image shows the Register New Web Hook option on the Register menu.
  6. 4Enter the webhook name, the Step 6: Invoke the process that you copied while invoking the process in the Endpoint URL field, and the authentication method in the Authentication field.
  7. The following image shows the WebHook Registration dialog box:
    The image shows the WebHook Registration dialog box.
  8. 5Go to WebHook and select Register New Step.
  9. The following image shows the Register New Step option:
    The image shows the Register New Step option.
  10. 6In the Update Existing Step page, enter the value as Update in the Message field, opportunity in the Primary Entity field, and select Asynchronous in the Execution Mode field.
  11. The following image shows the Update Existing Step page:
    The image shows the Update Existing Step page.
  12. 7In the Select Attributes dialog box, clear all the fields and select the Status and Status Reason custom fields to trigger the webhook when the opportunity status is updated.
  13. The following image shows the Status and Status Reason custom field attributes in the Select Attributes dialog box:
    The image shows the Status and Status Reason custom field attributes in the Select Attributes dialog box.