Nav

Microsoft Dynamics NAV Connector

Select

The Anypoint Connector for Microsoft Dynamics NAV enables Mule applications to interact with Microsoft Dynamics NAV Web Services. Microsoft Dynamics NAV is a global enterprise resource planning (ERP) solution to assist with finance, manufacturing, customer relationship management, supply chains, analytics and electronic commerce for small and medium-sized enterprise and local subsidiaries of large international groups.

The versions of Microsoft Dynamics NAV supported by this connector are:

  • 2013 R2

  • 2015

  • 2016

  • 2017

Prerequisites

This document assumes that you are familiar with Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

You need login credentials to test your connection to your target resource.

For hardware and software requirements and compatibility information, see the Connector Release Notes.

To use this connector with Maven, view the pom.xml dependency information in the Dependency Snippets in Anypoint Exchange.

What’s New in this Connector

First release for Mule 4.

Primary Use Cases

The Microsoft Dynamics NAV Connector supports these operations:

Operation Description

Page Operation

Execute one of the operations defined in published Page SOAP services.

Codeunit Operation

Execute one of the operations defined in published Codeunit SOAP services.

OData Query

Execute a Query against one of the NAV entities using the OData endpoint.

Getting Started

Before creating a sample flow, a published Page Service is necessary. See below.

To Connect in Design Center

  1. Click a trigger such as an HTTP Listener or Scheduler.

  2. Select the plus sign to add a component.

  3. Select the connector as a component.

  4. Left click on Set Up

  5. Configure these fields:

    ms dynamics nav config design

Parameter Description

Domain

Domain of the Dynamics NAV instance.

Username

The Windows username to connect to Dynamics NAV.

Password

The password for the user to connect to Dynamics NAV.

SOAP URL

Base URL where the SOAP services are exposed in the form https://<Server>:<WebServicePort>/<ServerInstance>/WS. Example: https://hostname:7047/DynamicsNAV90/WS

OData URL

Base URL where the OData services are exposed in the form https://<Server>:<WebServicePort>/<ServerInstance>/OData. Example: https://hostname:7048/DynamicsNAV90/OData

Company Name (Optional)

Dynamics NAV Company to which connect. In case the field is left blank, the default configured one is used.

Disable Cn Check

When dealing with HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an Exception. To prevent this it is possible to disable the CN (Common Name) check. Note: This is not recommended for production environments.

Select the desired operation and run the flow.

Connect in Anypoint Studio 7

You can use this connector in Anypoint Studio by first downloading it from Exchange and configuring it as needed.

Install Connector in Studio

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Click Login in Anypoint Exchange.

  3. Search for this connector and click Install.

  4. Follow the prompts to install this connector.

When Studio has an update, a message displays in the lower right corner, which you can click to install the update.

Configure in Studio

  1. Drag and drop an HTTP Listener to the Studio Canvas.

    ms dynamics nav listener anypoint

    1. Set the Path.

    2. Click the green plus sign to configure the listener.

  2. Drag and drop Dynamics Nav connector to the Studio Canvas.

  3. Click the green plus sign to add a configuration for the connector.

  4. Complete these fields.

    anyConfig

    Parameter Description

    Domain

    Domain of the Dynamics NAV instance.

    Username

    The Windows username to connect to Dynamics NAV.

    Password

    The password for the user to connect to Dynamics NAV.

    SOAP URL

    Base URL where the SOAP services are exposed in the form https://<Server>:<WebServicePort>/<ServerInstance>/WS. Example: https://hostname:7047/DynamicsNAV90/WS

    OData URL

    Base URL where the OData services are exposed in the form https://<Server>:<WebServicePort>/<ServerInstance>/OData. Example: https://hostname:7048/DynamicsNAV90/OData

    Company Name (Optional)

    Dynamics NAV Company to which connect. In case the field is left blank, the default configured one is used.

    Disable Cn Check

    For HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an Exception. To prevent this it is possible to disable the CN (Common Name) check. Note: this is not recommended for production environments.

  5. Click OK

  6. Configure these fields:

    ms dynamics nav op config

    • Query: The query that to run on Dynamics Nav.

    • Fetch Size: Number of items retrieved on one page.

Use Case: Studio

ms dynamics nav flow

USe Case: XML


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:nav="http://www.mulesoft.org/schema/mule/nav"
        xmlns:http="http://www.mulesoft.org/schema/mule/http"
        xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
    http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/nav
http://www.mulesoft.org/schema/mule/nav/current/mule-nav.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">

        <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config">
                <http:listener-connection host="localhost" port="8081" />
        </http:listener-config>

        <nav:dynamics-nav-config name="Nav_Connector_Dynamics_nav_config"
      doc:name="Nav Connector Dynamics nav config">
                    <nav:ntlm-connection
            domain="${config.domain}"
            username="${config.username}"
            password="${config.password}"
            soapUrl="${config.soapUrl}"
            odataUrl="${config.odataUrl}"
            companyName="${config.companyName}"
            disableCnCheck="true" />
    </nav:dynamics-nav-config>

    <flow name="query-flow">
                    <http:listener doc:name="Listener"
            config-ref="HTTP_Listener_config"
            path="/query"/>
                    <nav:odata-query fetchSize="10" doc:name="Odata query"
            config-ref="Nav_Connector_Dynamics_nav_config">
                            <nav:query>dsql: SELECT No FROM SalesOrders LIMIT 5</nav:query>
                    </nav:odata-query>
                    <ee:transform doc:name="Transform Message" >
                            <ee:message >
                                    <ee:set-payload ><![CDATA[%dw 2.0
    output application/json
    ---
    payload]]></ee:set-payload>
                            </ee:message>
                    </ee:transform>
    </flow>

</mule>