Tuesday, 5 July 2011

Dynamics CRM – NAV Connector(NAV Customisations)

Once the connector is installed you need to configure NAV to publish the web services for it.

Step 1 - Setup the connector.

This is fairly straight forward. Go to Marketing Setup and on the Synchronisation tab check the box ‘Enable Connector’ This will then prompt you to confirm that you want to setup the connector and when you OK it will build all the correct Web Service settings and Integration Page records.

When the connector is setup you will see a set of web services inside Dynamics NAV. To check them go to Administration –> IT Administration –> General Setup –> Web Services

image

In the Connector itself

Inside the connector you can see the entities that are coming from NAV by going into the Settings and then selecting the NAV Configuration Utility.

connector settings

Once you have connected to the database and selected the companies from it you which to connect with you will get a list of the published entities from it

connector entities 1

This will give you all the standard tables and fields, but often you will want to add new fields and tables that are specific to the customer

Step 2- Add Custom Fields on tables already mapped

To add a new field to a table already mapped you only need to modify the Page.

Nav Contact

Here I have added Name 2 to the Contact Page

As all the fields on a Page are exposed as the WSDL this will automatically update the list of available fields when you next refresh the Connector

Map Fields 2

Here we can see Name 2 has been added to the source fields list in the connector.

Step 3 - Add Custom Tables

Again this is fairly straight forward.

In order to get the system to automatically add the entries to the Web Services and the Integration Page tables you need to modify Coudeunit 5150. There are 3 functions you need to modify.

EnableConnector

In teh EnableConnector Function you need to add a new line for each new table. This allows the routine to determine what the correct Form and table ID’s are for your new table. If you want to force a specific form you can specify it here.

In this example I am adding the Vendor to the connector

 


EnableConnector()


IF NOT IntegrationPage.FINDFIRST THEN BEGIN


  SetupWebServicePages(FORM::"Resource List",DATABASE::Resource);


  SetupWebServicePages(FORM::"Payment Terms",DATABASE::"Payment Terms");


  SetupWebServicePages(FORM::"Shipment Methods",DATABASE::"Shipment Method");


  SetupWebServicePages(FORM::"Shipping Agents",DATABASE::"Shipping Agent");


  SetupWebServicePages(FORM::Currencies,DATABASE::Currency);


  SetupWebServicePages(FORM::"Salespeople/Purchasers",DATABASE::"Salesperson/Purchaser");


  SetupWebServicePages(FORM::"Customer Card",DATABASE::Customer);


  SetupWebServicePages(FORM::"Item Card",DATABASE::Item);


  SetupWebServicePages(FORM::"Sales Order",DATABASE::"Sales Header");


  SetupWebServicePages(FORM::"Sales Invoice",DATABASE::"Sales Header");


  SetupWebServicePages(FORM::"Posted Sales Invoice",DATABASE::"Sales Invoice Header");


  SetupWebServicePages(FORM::"Units of Measure",DATABASE::"Unit of Measure");


  SetupWebServicePages(FORM::"Ship-to Address",DATABASE::"Ship-to Address");


  SetupWebServicePages(FORM::"Contact Card",DATABASE::Contact);


  SetupWebServicePages(FORM::"Currency Exchange Rates",DATABASE::"Currency Exchange Rate");


  SetupWebServicePages(FORM::"Customer Disc. Groups",DATABASE::"Customer Discount Group");


  SetupWebServicePages(FORM::"Item Disc. Groups",DATABASE::"Item Discount Group");


  //New Table


  SetupWebServicePages(FORM::"Vendor Card",DATABASE::"Vendor");


 


  SetupIntegrationService;


END;


 


MarkDeletedIntegrationRecords;


SetupIntegrationTables;




SetupIntegrationTables



You need to add a new line for each table here





 


SetupIntegrationTables()


InitializeIntegrationRecords(DATABASE::Resource);


InitializeIntegrationRecords(DATABASE::"Payment Terms");


InitializeIntegrationRecords(DATABASE::"Shipment Method");


InitializeIntegrationRecords(DATABASE::"Shipping Agent");


InitializeIntegrationRecords(DATABASE::Currency);


InitializeIntegrationRecords(DATABASE::"Salesperson/Purchaser");


InitializeIntegrationRecords(DATABASE::Customer);


InitializeIntegrationRecords(DATABASE::Item);


InitializeIntegrationRecords(DATABASE::"Sales Header");


InitializeIntegrationRecords(DATABASE::"Sales Invoice Header");


InitializeIntegrationRecords(DATABASE::"Unit of Measure");


InitializeIntegrationRecords(DATABASE::"Ship-to Address");


InitializeIntegrationRecords(DATABASE::Contact);


InitializeIntegrationRecords(DATABASE::"Currency Exchange Rate");


InitializeIntegrationRecords(DATABASE::"Customer Discount Group");


InitializeIntegrationRecords(DATABASE::"Item Discount Group");


//New Table


InitializeIntegrationRecords(DATABASE::"Vendor");




IsIntegrationRecord



You also need to add a reference in here so the system knows that the Table is part of the integration.





 


IsIntegrationRecord(TableID : Integer) : Boolean


IF TableID IN


   [DATABASE::Resource,


    DATABASE::"Payment Terms",


    DATABASE::"Shipment Method",


    DATABASE::"Shipping Agent",


    DATABASE::Currency,


    DATABASE::"Salesperson/Purchaser",


    DATABASE::Customer,


    DATABASE::Item,


    DATABASE::"Sales Header",


    DATABASE::"Sales Invoice Header",


    DATABASE::"Unit of Measure",


    DATABASE::"Ship-to Address",


    DATABASE::Contact,


    DATABASE::"Currency Exchange Rate",


    DATABASE::"Customer Discount Group",


    DATABASE::"Item Discount Group"


    //New Table


    //DATABASE::"Item Discount Group"]


    DATABASE::"Item Discount Group",


    DATABASE::"Vendor"]


 


THEN


  EXIT(TRUE);


 


EXIT(FALSE);




Once this is done you can refresh the integration by Un-checking the  Enable Connector box in Marketing Setup and then rechecking it again. This will refresh the settings. NAV webservices



When you next refresh the connector you will find the new entity



connector entities 2 

















Now the Vendor Card appears in the list of entities and just needs to be enables to be used in a map.

Dynamics CRM – NAV Connector

With the release of NAV2009R2 Microsoft came the release of the Dynamics Connector for NAV and CRM.

The connector itself has been around for a while and was in use with Dynamics GP and CRM. Since it came out with NAV I have had a play with it and I have a couple of sites that are at various stages in implementing it.

Personally I think linking Dynamics NAV with Dynamics CRM gives a very powerful solution. The users access by the method that makes most sense, fairly often we see uses needing to deal with customers or vendors and track interactions but with a limited impact on the ERP. They maybe raising orders or making basic enquires but they don’t need all the functions that the ERP provides.

Often sales wants to be out and about working in an offline capacity. The offline integration with Outlook in CRM makes this possible, plus it presents a familiar interface.

The connector provides out of the box integration for these sorts of things.

NAV-CRM Mapping

The connector itself acts as a mapping tool and uses web services on both sides to handle the integration.

NAV-CRM Overview

While working with it I have found the amount of information on how to add customer fields and tables to the connector to be limited

In the next 3 posts I’ll look at how to setup and customise the connector.

The first will look at Dynamics NAV
The second Dynamics CRM
and finally the third will look in more detail at the connector itself