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
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.
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
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.
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
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.
When you next refresh the connector you will find the new entity
Now the Vendor Card appears in the list of entities and just needs to be enables to be used in a map.