GP and D365 Sales Integration – All in One
The Dynamics GP and Dynamics 365 Sales templates facilitate easy data integration between the most commonly used modules in Microsoft Dynamics D365 Sales and GP using SmartConnect. They provide an easy to install and ready to use Dynamics 365 Sales to GP integration option allowing Dynamics 365 Sales users to integrate data between GP and Dynamics 365 Sales as a one time bulk import as well as set up real-time or scheduled maps to keep both systems in sync. Several end points have maps sending data both directions, such as items or accounts. This allows. Each map can be used as-is or can be used as a great starting point to customize further. The provided maps integrate to:
- Payment Terms
- Price Lists
- Ship Methods
- Sales Territories
- Sales people
- Units of Measure
The GP-D365 Sales templates contain 44 different maps consisting of bulk maps, real-time maps, and change maps. There are maps going from Dynamics 365 Sales into GP and maps going from GP into Dynamics 365 Sales. Because of the many types of maps, the naming convention used is:
- Maps that begin with “GP_” send data from CRM INTO Dynamics GP
- Maps that begin with “CRM_” send data from Dynamics GP INTO D365 Sales
- Maps that end with “_RT” are real-time, “_CH” are change based, “_BK” are bulk maps
D365 Sales Templates Set Up
Setting Up Connectors
The maps will all use ODBC Data Source connectors to the database that are set up once and used through most of the maps. There will be two separate connections set up for the company and dynamics database, respectively. To set up the use ODBC Data Source connectors for the maps, brows to the Maintenance tab in SmartConnect and click on the ODBC Data Source button in the Generic Connector pane. When the ODBC Defaults window appears, create two connectors with an initial connection in the company database and in the dynamics database. The name of the connection you choose will be used in the Map Setup window as the Connection Type.
The two ‘GP_SLSPN_’ maps require connecting to the company database through a calculated field. This calculated field uses a MSSQL connector that is set up by clicking the MSSQL Defaults button from the Maintenance Tab within SmartConnect.
- Import the ‘Dynamics CRM-GP Templates.sce’ file. It contains 44 maps to integrate data between GP and D365 Sales. Not every map needs to be imported, but note that certain necessary for the Sales Order and Account data integration between D365 Sales and GP.
- The order in which the maps need to be run is specified in section Running D365 Sales Template Maps.
Connection Type Setup
The templates sending data from GP into D365 Sales will use one of two connection strings for the Dynamics database and Company database. To set up the connection strings, go to the Maintenance tab from the main SmartConnect window. Click on ‘ODBC Data Source’ from the ‘Generic Connector’ pane. From this window, create two connections: one with initial connection to the company you will be exporting from, and another from the Dynamics database. Because these connection strings will be named and set up by the user, every map requires the ‘connection type’ be set before running the template. The appendix table with a List of D365 Sales Templates shows which maps require which initial connection.
Because there are many ways to import data between GP and D365 Sales, some of the maps may need to be changed for your specific requirements. Some of the changes include:
Currency from GP to D365 Sales
For all the templates mapping currency ID in Great Plains to ISO Currency in D365 Sales, the ISO Currency is set in a case statement within the query. If you are using a currency other than what is provided in the query, you can add additional cases to the query.
For templates mapping ISO currency in D365 Sales to currency ID in GP, a translation table is included with these maps. If you are using a currency other than what is provided in the translation table, you can add additional cases to the translation table.
Multi-lookup option default values
The maps that import from GP to D365 Sales and populate drop-down items in D365 Sales will use a multi-lookup to populate these fields e.g. ‘Shipping method’ and ‘payment terms’. The query on these maps will include a hard-coded default value to be used if a record does not have a value at this field. For these maps, the value is set from within the query in a CASE statement. To change the default settings, simply update the hard-coded value in the query to what you would like the default to be if there is a blank value.
The Currencies map brings over the names of all the currencies, but hard-codes the exchange rate to 1 because multiple exchange rates can be set up for a given currency. Also note that the ‘Connection Type’ from the data source must have an initial connection to the Dynamics database.
Orders from D365 Sales to GP
D365 Sales doesn’t include as many input fields as GP, so certain fields have been hardcoded to constants. The orders map has Document ID set to ‘STDORD’, batch number set to ‘CRMBAT0001’, and Location code set to ‘WAREHOUSE’. These can be set to new constants or can be mapped to another field from D365 Sales. If an entity is customized to allow entry of these fields from within D365 Sales, these new customized fields can be mapped instead.
The Smart Connect maps for the D365 Sales sales order and account integration must be run in the specific order. Firstly, run all the bulk maps, and then register the real time maps.
Bulk maps must be run in the order specified below. For some maps to run, data must exist, eg. Currency must exist for the exchange rate map to run. If the pre-requisite data does not exist in the destination system, your map may not run successfully.
Before running each map, configure the connection string to point at the correct data source: Map Setup -> Data Source. Click the lookup button next to connection string. Then, select the company in which the maps should be run.
This is the list of bulk maps by map ID that you will need to run as follows:
- CRM_CURR_BK – import all GP Currency to D365 Sales
- CRM_SLS_TER_BK– imports sales territories from GP into D365 Sales
- CRM_SLSPN_BK – links the sales person in GP and the user in D365 Salesusing the email address and Sales ID. The Sales Person email address must exist in GP. Email and Sales persons ID become a unique identifier of each D365 Sales user. After the import, the D365 Sales users should have the Sales ID, which were imported from GP.
- CRM_SHIPMETHOD – imports the shipping methods used in GP to D365 Sales lookup fields. By default, all shipping methods will be sent to D365 Sales and published directly from the map. If you do not use the shipping method drop-down lists in D365 Sales, this map is not required. If you choose not run this map, the multi-lookup named ‘MLK_SHIPMETHOD__ATTRIBUTEVALUE’ in map ‘CRM_ACC_BK’ map must be unmapped.
- CRM_PAYMENTTERMS – imports the payment terms used in GP to D365 Sales lookup fields. By default, all payment terms will be sent to D365 Sales and published directly from the map. If you do not use the payment terms drop-down lists in D365 Sales, this map is not required. If you choose not to run this map, the multi-lookup named
- CRM_ACC_BK – imports customers into D365 Sales
- CRM_ADDRESS_BK – imports customer primary address and any additional addresses the customer may have
- CRM_PRCLEVEL_BK – imports price levels from GP into D365 Sales
- CRM_UOFM_BK – imports various Unit of Measures to be used on Sales Order and Invoices
- CRM_ITEMS_BK – imports inventory items from GP into D365 Sales. ‘Discontinued’ and ‘Kit’ items will not be imported because D365 Sales does not list these types in the product type drop-down list.
NOTE: D365 Sales does not allow a negative quantity for new items. If an item is imported with a negative quantity, a validation error will occur on the value of ‘quantityonhand’ from the SmartConnect Progress window.
- CRM_PRICELIST_BK – import Currency Price Lists
- CRM_INVOICE_BK – import invoices from GP into D365 Sales
Real Time and Change Maps
There exists a real time map for all bulk maps. For GP to D365 Sales maps, there also exists a change data source map as well. To use a real-time map, register the map on both Create and Update events. The maps with an exception are the CRM_ITEMS_RT and GP_SLSORDER_RT maps, which should only be registered on the update events.
Changing/Customizing Real Time and Change Maps
The query between bulk maps and real-time or change maps are very similar, though real-time and change maps must be edited through the query builder window instead of SQL directly. The screenshot above shows how a CASE statement can be entered through the query builder.
Because of the similarity between bulk maps and real-time or change maps, the templates are a great way to see how the query builder processes queries.
These maps have been created and can be used on as needed basis for bulk sales and order data import from D365 Sales to GP:
- GP_ACC_BK – to import all your D365 Sales accounts into GP
- GP_ADDRESS_BK – to import all your D365 Sales account addresses into GP
- GP_SLSPN_BK – to import all your D365 Sales salespeople into GP. This map uses a calculated field that accesses the DYNAMICS database through a MSSQL default connection set up outside of the map. To set this up, see the section above on setting up connection strings. After creating the MSSQL connector, verify this name is used within the calculated field. By default, the calculated field will attempt to create a new ID using the last name and first character of first name, but can be changed through the field.
- GP_ITEM_BK – to import all your D365 Sales products into GP
- GP_ORDER_RT – to send newly created orders in D365 Sales to GP. This file will import both the GP_ORDER_RT map as well as the CRM_ORDER_CH map. The CRM_ORDER_CH map is a change based map that sets the status of the orders in D365 Sales to Submitted/In Progress. This map is set as a Map Post Task of the GP_ORDER_RT map to automatically set the order status every time an order is brought into GP successfully.
- If the multi-lookup does not find the appropriate shipping method, the entire record will error out. Depending on how your system is configured, there are two options:
- Run the CRM_SHIPMETHOD map and import all of the shipping methods into D365 Sales
- Un-map the MLK_SHIPMETHOD from the SmartConnect Mapping window
- If all records fail sending from D365 Sales to GP because Payment Terms ID does not exist, verify that option sets are being returned from the Map Setup window by checking the ‘Return Option Set Labels’ box. This will return the displayed name in a query instead of the numeric value.
- Sales Person is not setup as an active user in D365 Sales (Settings – Administration – Users Maintenance – the sales person must be set up in D365 Sales as a user otherwise the following eConnect error will occur)
- CRM_SLSPN_BK runs but does not import any data – check that the sales person has an email address in GP.
- Map GP_SLSPN_BK fails with error in calculation column ‘SALESPERSONID_CALC’. The calculated field accesses the DYNAMICS database using a MSSQL Default connection that must be set up. Read the instructions on setting up connectors and the map description for GP_SLSPN_BK.
- Map CRM_ACC_BK fails to import accounts that belong to the D365 Sales User (which is equivalent of the GP Sales Person). Check the user has sufficient rights to own Accounts. If not, assign a role as appropriate and re-run the map.
- If you have not entered any order lines (add existing product), your order will not be pushed into GP. (not much point having an order with no lines)
- D365 Sales Account Relationship Type must be set to ‘Customer’ (relationship type =’3’), else map will not work (due to a restriction on the Real Time data source). Of course, if you want a different restriction it can be configured within the map.
- D365 Sales Customer number must be entered otherwise the map will not integrate data for that record.
- GP_SLSPN_BK – must enter Sales Territory against the Sales Person/User. If not, you may get the error in the event viewer “GP_SLSPN_BK validation failed. Source column does not exist in the source data.”