Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Add question

You must login to ask question.

Login

Register Now

APPSeCONNECT community provides a new way for integration super heros connect the external world. Join hands together to build a community of people to help each other, solve problems or share knowledge.

Integrating Microsoft Dynamics NAV with Solve 360 using REST Connector

Integrating Microsoft Dynamics NAV with Solve 360 using REST Connector

Table Of Contents

  • Introduction
  • Background
  • Prerequisites
  • Business scenario
  • The prerequisites
  • Steps
    • Technology app Creation
    • Schema Addition
    • Endpoint Configuration & Action and Error filter Configuration
      • Endpoint Configuration
      • Action Filter Configuration
      • Error Filter Configuration
    • Connection Creation
    • Workflow Creation
    • Credential validation
    • Connection Deployment and Environment
  • Setup
  • Workflow Execution
  • Conclusion

Introduction:

Microsoft Dynamics NAV is an ERP platform which caters the business requirement for almost any size of business that is from mid-level to large levels. Here is an Infographic on the evolution of Microsoft Dynamics Nav from PC-Plus!

But at the same time you have a CRM application which is not as famous as Microsoft Dynamics NAV but it satisfies your requirement. The main objective of any business cycle is to reach run these applications simultaneously.

Business applications need to be integrated to fulfil this requirement. Though there are many platforms which provide readymade templates for Integrating Microsoft Dynamics NAV but often the application on the other side is not the one you are looking for. Apps which are less famous use REST protocol for creating their API Services.

In this article I will discuss how can you integrate Microsoft Dynamics NAV with your other REST application on the APPSeCONNECT platform.

Background:

As discussed earlier, integration of applications is a requirement for any Business who want their cycle to run on real time data as thus it helps you to connect various applications so that your hired IT Team does not have to switch between applications to get the desired records.  It also ensures that the employees are dedicated towards raising your business at new heights rather than wasting human labor in maintaining the applications and updating them according to the requirement.

 

Prerequisites:

Here are the list of prerequisites you need to have before configuring your NAV with your unique RESTful application.

  • An active account in APPSeCONNECT Portal.
  • Proper credential details of your NAV or any other ERP.
  • Credentials of the other app which you need to integrate with NAV.
  • A proper API documentation of the other application.
  • POSTMAN application to find out HTTP protocols, authentication, endpoint, URL, request headers, parameters.

Business scenario:

In this article, I am going to discuss integration of Microsoft Dynamics NAV with a CRM application ‘Solve 360 CRM’. This article will guide you to integrate these apps right from the scratch. In the market, there is almost no ready template for NAV-Solve 360 CRM.

Though there are many organizations which offer personalised integration solutions, but this only results in higher cost. But APPSeCONNECT provides you to integrate any RESTful app with Microsoft Dynamics NAV. Solve 360 CRM is a RESTful application.

Solve CRM has mainly two modules: Company & Contact. In this article, the Customers from NAV will get synced as Company in Solve CRM and the Contacts from Solve CRM will get synced as Contact Person in NAV.

The following will the field mapping for Contact.

 

Fields in Solve CRM (Source App) Fields in Microsoft Dynamics NAV (Destination App)
name Name
businessemail Email
cellularphone Phone No

 

The following will the field mapping for Company.

 

Fields in Microsoft Dynamics NAV (Source App) Fields in Solve CRM (Destination App)
Name name
Phone_No businessphonedirect
Email businessemail

Let’s Get Started:

Below are the steps in brief, which we need to follow to integrate Solve CRM (personal app) with Microsoft Dynamics NAV without using any predefined template and fully customized according to your own requirements.

 

STEP 1 Technology app Creation
STEP 2 Schema Addition
STEP 3 Endpoint & Action and Error filterConfiguration
STEP 4 Connection creation
STEP 5 Workflow Creation.
STEP 6 Credential validation.
STEP 7 Connection Deployment and Environment Setup.
STEP 8 Workflow Execution.

 

Before you go through the steps below in detail, the prerequisites must be fulfilled.

 

The prerequisites

Generally the information written under this headline is easily gathered from the API documentation of the GENERIC APP you are using which is ‘Solve 360 CRM’ in this case. The points which should be noted from the API docs of the external REST application is:

Authentication:

Authentication type: Basic

Username: Registered mail id of the Solve CRM application.

Password: API key of the Solve CRM application. [The steps to fetch the api key is well discussed in the API documentation site of Solve 360 CRM].

[Authentication type can be Oauth2.0, in that case you need to note about Client id, Client Secret, Auth token URL, Access Token URL, Call back url, Scope and so on.As this is required for generating access token and refresh token.]

 

Content Type: Any REST application support XML or JSON or both.

In this case for Solve 360 CRM, XML is the content type.

 

Request URL Identification: Always try to fetch and post data from the generic application using POSTMAN.

Authentication: Basic. The Username and password is provided.

The HTTP request: GET

The web API urls:

https://secure.solve360.com/contacts ——– (1)

https://secure.solve360.com/companies——-(2)

 

The expected result:

  1. Will fetch all the list of Contacts present in my Application irrespective of any parameter.
  2. Will fetch all the list of Companies present in my Application irrespective of any parameter.

The URL needs to be split into two Parts: Base Url and the Endpoint.

The Base URL remains the same for any module of the application but the Endpoint keeps changing according to the module requirement.

solvecontactapi

The above picture makes it quite clear how to split the URL into two parts.

Request Headers and Parameters:

Always note down the request parameters and headers you need to provide while making an API call to get a successful response, 200Ok

Now you are actually communicating with your REST application!!!

Let’s proceed towards the steps.

Technology app Creation

After getting valid credentials of APPSeCONNECT portal in your registered mail id, log in the portal. You will need to change the password when you first log in to the portal. After completion of this basic step, concentrate on the left-hand vertical menu bar.  Click on Apps>> Choose Apps. From the dropdown select ‘Microsoft Dynamics NAV’ and the version ‘>=2009’. Then Click on ‘Add’.

From the ‘Choose App’ dropdown select ‘Create Technology App’.

techappcreation

Now fill in the new tech app details, which is in this case ‘Solve 360 CRM’.

App name: Solve CRM

Description: REST Application

Adapter (select the proper Radio Button): REST

Cloud enable (select the check box): Tick the check box.

techapp

Your personalised TECH app is now ready!!!!

Now in the app page you will find two apps: first is the Microsoft Dynamics NAV and the next is Solve 360 CRM.

So the apps selection is now complete.

Schema Addition

In this step, you can add the data packet structure of any specific module of an application. As Solve 360 CRM is the new tech app which we have created, we now need to create or import the Schemas. Creating schemas is a time taking process and here APPSeCONNECT eases the process by providing you the feature to import the schema where schema creation can be done within a couple of minutes.

Here you need to import two schemas one for ‘Company’ module and ‘Contact’ module.

After you have fetch data records for both ‘Company’ and ‘Contact’ in postman, store these data responses individually with the extension of ‘.xml’.

 

Go to App >> Click on (+) >> Schema >> Import >> Click on XML >> Add the file from the proper location >> Click on ‘Display’.

protocl

The next screen which appears is:

importschema

Choosing the file of Contact.xml, provide the root element and click on display.

upload schema

After saving, the schema gets imported.

Do remember to set a unique attribute as ‘Primary key’ as it will generate the list of record ids in the resync bucket.

schema definition

Endpoint Configuration & Action and Error filter Configuration

Under the Prerequisite discussion, what is an endpoint and why do we need it? The answer to these questions is quite clear. Endpoint clearly is the name of the module which we want to access. The name of the Endpoint is the field which actually concats with the base URL to form a Base URL.

Endpoint Configuration:

To define the endpoint Go to App >> Click on (+) >> Schema >> Add Action(+)

action

End point: contacts

Description: Gets contacts from solve 360 crm

actiondescription

Action Filter Configuration:

After define endpoint for the REST based connection by providing the endpoint name and description. Click on ‘Save’. The below screen appears. You now need to Define the http method and content type and required headers and parameters.Always click on the Save icon after defining the header or parameter.

[Defining Header and Parameter Varies from application to application. Some app might need both, some might just need Header/parameter]

filter configuration

Solve 360 CRM requires only parameters. I wish to fetch data from the app with respect to date and time. Thus using the parameter ‘created’ as the key. The list of usable parameters is available in the API Documentation of SOLVE CRM 360.

To get data with respect to date and time always define the value for that parameter or header to be ~{ReadDate(‘yyyy-MM-ddTHH:mm:ssK’,’0′)}~ where the key will be the name of the field or parameter [depending on the app used].

 

Error Filter Configuration:

You now need to Define the http method and content type same as the Action filter.

This configuration will help to resync failed Data records.

error filter

Under the resource path section, in the key section provide the endpoint_name/$. In this case it is ‘contacts/$’.Always click on the Save icon after defining the resource path. The value field will remain blank.

Create another Endpoint for Posting companies [under the company schema] to Solve 360 CRM. Choose the http method to be POST and so on.

Connection Creation

Again concentrate on the left hand vertical menu bar in the APPSeCONNECT Portal.  Click on Connections>> Create Connections>> Configure Connector.

connection creation

Provide the connection name.Click on the check box for ‘Is Cloud Supported’ and then ‘Save’.

save connection

Workflow Creation

Again concentrate on the left hand vertical menu bar in the APPSeCONNECT Portal.  Click on Workflow>> Create workflow.

From the left hand menu drag the start node

start node

followed by the ‘Template>>General Template>> Create Touchpoint’ option.

touchpoint creation

After you click on ‘Create Touchpoint’, Provide details like Name, Group (transactional Data), Description.Then click on next.

touchpoint creation wizard

The Source Setup Page opens. Select the mandatory fields – Schema, Action, Protocol and the Method. You can also Add New Schema & New Action, by clicking on the respective buttons. Click on the Continue button.

setup touchpoint

Note: The Schema and the Action should be selected according to the nature of the touchpoint. Suppose, the touchpoint is of Product Add, the Schema and the Action should be selected for the Product only.*

In this case :

Schema :Item   Action: Get contacts from solve CRM

Now Click on ‘Continue’.

The Target Setup page opens. Fill the mandatory fields – Schema, Action, Protocol, and Method. Similar, to the Source Setup here too New Schema/New Action can be added by clicking on the respective buttons. Click Continue Button.

uploading adapter

The Transformation/Mapping Page opens

transformation

The data coming from the source schema requires to be transformed individually such that it matches the format of the destination schema, everytime the touchpoint is synced.

In this case on the left you will find the fields of the Contact Person Card of Microsoft Dynamics NAV, now you need to do the mapping from the fields from Contact data Packet of Solve CRM. We will be doing it according to the table:

 

Fields in Solve CRM (Source App) Fields in Microsoft Dynamics NAV (Destination App)
name Name
businessemail Email
cellularphone Phone No

 

Transformation:

Under the For-each-loop section, Here a loop is set relatively than writing the transformation logic multiple times, and this undergoes execution whenever the touchpoint is synced in the For-Each Loop Node. The xpath of the loop is written with respect to the input packet.

mapping

Root Variables:

A root entity variable is a variable that is value specific to every iteration. Every entity item has this variable declared with it such that it is present in every iteration and has a different value for every schema item.

The Root Entity Variables used in this case is:

  1. maxDate: This root variable needs to be added to the mapping section when the source app is configured using REST adapter. This root variable fetch the date and time of the latest data record created in the Source app and store it so that whenever the sync is executed after the first sync, it does not fetch the old records every time. This ensures quick sync process.

Root variable name: maxDate

Type: String

Mapping: [sourcelib:WriteMaxDate(..,'{parent tag for each individual record}’,'{tag which as the value of the date & time when the record got created /updated}’,’1′)]

Example: [sourcelib:WriteMaxDate(..,’Customer’,’createTime’,’1’)]

After completion of transformation section click on ‘Continue’.confirmation

Then click on finish.

Drag the End node.

Connect all the three, that is Start , Group node, end.

workflow creation

  1. Click on ‘Reset Generate’.
  2. Click on ‘Reset Publish’.
  3. Name the Workflow.
  4. Publish the Workflow.
  5. Save the workflow.

Again concentrate on the left hand vertical menu bar in the APPSeCONNECT Portal.  Click on Workflow. You will find the list of workflows in your organization.

Activate the workflow.

activate

Similarly create a Company Add Workflow which adds Customers from NAV to solve CRM.

Credential validation.

To set the credentials Go to App >> Click on (+) >> Credentials.Do this step for both the apps you are using that is NAV and Rest app: Solve 360CRM

Provide the credential name.

The Base URL of the application. In this case it is: https://secure.solve360.com/

Content type: application/xml

Authorization: From the dropdown select the desired auth type, basic or Oauth2.0

I have chosen Basic as it goes with the Solve 360 CRM.

Provide the username and Password.

Click on ‘Save’.

credential

Provide the credentials for NAV too. The Fields will be Different in this case.Click on Save.

Connection Deployment and Environment Setup.

Go to the Connection page now, hover on the connection you have created.Click on the ‘Configuration Assignment’ button.

deployment

Select the credentials you want to assign for the apps. Click on ‘Save Changes’.

deploying connection

Hover on the same connection, Click on the toggle button to deploy the connection.

already setup connection

Now the credentials have been deployed in the connection.The Blue tick ensures the same

activate and schedule

On the left portal menu, Go to Manage >> Environment>> Create Cloud Environment.

creating environment

Then the following screen appears. Click on Save.

create cloud environment

Your environment is now ready.

Workflow Execution

Go to the Workflow Page>> Open the created workflow>> Click on play button

play workflow

The Workflow execution starts with a message: Workflow Started.

in execution workflow

After the Execution is done, Click on the group node>> Resync Bucket.

executed data repository

You will find the data in the resync bucket and its status as well.

 

Conclusion:

After the completion of only these eight steps, you can completely integrate you REST application with Microsoft Dynamics NAV.

APPSeCONNECT is the platform which allows you to integrate your personal REST application as per your requirement with your ERP: Microsoft Dynamics NAV.

Any application which follows a REST protocol, can be used to integrate with the choice of application you want.

About ArpitBeginner

Leave a reply

Share via
Copy link
Powered by Social Snap