Sync Datarails with Microsoft Dynamics 365 Business Central

Datarails Integrations solution is a plan that lets you consolidate all your data sources and seamlessly connect your external apps to the Datarails web app. For more information contact our integrations team here.

What you need to get started:

  • Admin user rights as well as passwords for both:
    • Your Microsoft Azure Console 
    • Your dedicated MD 365 account for Datarails synchronizations (or another account with relevant permissions) 
    • Your Datarails account
  • Know which data table you want to sync with Datarails

Step 1: Create an Application on Azure Console

  1. Sign into Microsoft Azure Console as an admin. 
  2. Search for Azure Active Directory, under Services click on Microsoft Entra ID.
  3. Under Manage panel on the left, click on App Registration.
  4. Click on New Registration
  5. A new screen opens. In the Name field write "Datarails App".
  6. For Supported account types, leave as default or the one that fits your needs. 
  7. For Redirect URI, select the platform Web, and insert the following url: https://businesscentral.dynamics.com/OAuthLanding.htm
  8. Click on the Register button.
    create an application.png

Copy Information

  1. Navigate to Overview on the left panel.
  2. Please copy and save the following information: 
    • Application (client) ID
    • Client Secret - This is the Value we saved from Step 2.5
    • Directory (Tenant) ID

App information to copy.png

Step 2: Create a client secret and give permission for this App

Create a Client Secret

  1. Navigate to Certificates & secrets on the left panel.
  2. Click New Client Secret
  3. In the Expires dropdown, choose the relevant time, preferably the longest time. 
    client secret.png
  4. Click the Add button.
  5. Copy the Value, and save it in a note for later. Note if we navigate away the Value will disappear. Make sure you are copying Value and NOT Secret ID. secret value.png

 

Give permissions for the app

  1. Navigate to API Permissions on the left panel.
  2. Click Add a permission.
  3. Under Select an API, choose Dynamics 365 Business Central. azure permissions.png
  4. Choose Application permissions, check off all relevant permissions. Best practice is to check all the permissions. Note that Datarails is a READ ONLY application. 
  5. Click the Add permissions button. azure permissions 2.png
  6. After adding permissions, please choose Grant admin consent

 

Step 3: Get the MD 365 Web Service URL

  1. Login to Microsoft Dynamics BC as an Admin user. 
  2. Navigate to the search icon and enter "Web Services". Click Web services, a long list of web services will show.
    search for webservices.png
  3. Click any page (it doesn't matter which one), and when the page opens, click the link in the
    column ODataV4. When the page opens, copy the url up to and including OData V4 and
    save it for later. (Ex. http://api.clientcompany.dynamics.com/v2.0/376282bc-2tef-5ca-b1fb45632/LiveProd/ODataV4/)

Step 4: Give the app access to your Business Central account

  1. Navigate to the search icon and enter "Microsoft Entra ID" and click Microsoft Entra Application.
  2. Click on New to add the new application.
  3. Fill out the fields as follows:
    • Client ID: Paste the Application (client) ID you copied previously
    • Description: "Datarails APP"
    • State: Choose Enabledapplication.png
  4. Under User Groups, choose D365 BUS FULL ACCESS code. To be able to pull from all company entities you need the column Company Name to be blank, if you wish to give access to certain companies you will need to give permissions for each company.
  5. Under User Permission Sets section choose the following permissions:
    • D365 BUS FULL ACCESS
    • SUPER (DATA)permission sets.png
  6. Choose Grant Consent. You will be prompted to enter your Microsoft credentials. Once it is confirmed you will get a pop-up saying Consent was given successfully.

To setup the Datarails connection please have the following values that we saved in previous steps:

  • Application (client) ID
  • Client Secret - the Value we saved from Step 2.5
  • Service URL (ODataV4)
  • Directory (tenant) ID

Step 5: Create a New Data Source in Datarails

With the MD 365 setup complete, the Datarails-side of the synchronization can begin. You will be using values saved in the previous steps. 

  1. From the left panel,, select Admin > Data Sources.
  2. From the top right of the screen, click the + icon. The Add Data Source dialog box appears.
    data source.png
  3. Complete the dialog box:
    • Organization: Your company
    • Type: Microsoft Dynamics -Oauth 2.0
    • Sync User: Your Datarails sync user
    • Name: Give the integration a name
    • Service URL: The Service URL (ODataV4) Note: up to ....../ODataV4/
    • Client ID: Applicatio (client) ID 
    • Client Secret: Client secret
    • Tenant ID: Directory (tenant) ID
  4. Click Save.
  5. Click Test. If you see "OK" in the Test Results box, you are ready to continue
    test results.png
  6. Click Close.

Step 6: Create a New Filebox

On the Datarails main page.

  1. Navigate to Workspace > Main via the panel on the left.
  2. Click New + on the right and select New Filebox.
  3. In Create a new Filebox, only the following are mandatory:
    • Name - Give the Filebox a name, for this example please use the name "Company Names"
    • Date Tag - Toggle on and choose month
  4. Click Create & Close to be taken back to your workspace. 

Step 7: Query for Company Names

Navigate to find the Company Names Filebox you just created

  1. Scroll down to the Data Connection section
  2. From the drop down on the right choose the data source "MicrosoftDynamics365Financials - Microsoft Dynamics"
  3. Find Object Types - Object to query and in the empty white box on the right side find the query "Company" 
  4. Leave all the other settings as is. Next to Save data integration click Save
  5. Above this next to Sync now click Sync Now

company filebox.png

  1. Navigate to the Versions tab  
  2. Hover over the 3 dots on the right side and click Preview version
    preview version.png
  3. The preview will open in a new tab. From the list of names in the first column, choose which company name you want to work with and save it for later. 
  4. This Filebox will forever contain the query that holds all of the company names. You can refer back to them at any time. 

Step 8: Synchronize the Data

This example is for a General Ledger using the query "general_ledger_entries_excel". Other queries will have different syntax. 

  1. Create a new Filebox
  2. From Workspace, select the Filebox you just created and click the Settings tab
  3. Scroll down to the Data Connection section
    data connection.png
  4. Complete these fields:
    • Data Connection Type: "MicrosoftDynamics365Financials - Microsoft Dynamics"
    • Object Types - Object to query: From the dropdown, select one of the tables available.
    • Sync Query - Query for sync: Insert the following query, replacing COMPANYNAME with the company name you selected from the last step:
      • company=COMPANYNAME&$filter=Posting_Date ge {{date_tag|somonth}} and
        Posting_Date le {{date_tag|eomonth}}
  5. Click Save.

    • If the settings are accepted, you will see the message "Query Saved" at the bottom of the screen.

  6. Click Sync Now.

    • If the settings are accepted, in the top right of the screen you will see the message "Command Sync Now sent successfully," as shown below:
      sync_success.png

  7. When all the settings are accepted, you're ready to move to the next step.

Step 8: Review and Verify the Synchronization

  1. From the Versions tab, you can see the file that was imported.
  2. To verify that the data is correct, click the 3 dots ​⋮ icon and select Preview Version.
  3. Verify that the data is as expected. Here's an example.
    sync_sage_intacct_sample_data_preview.png

You're all set!




© Datarails Ltd. All rights reserved.

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.