Technical Support Hours

M-F 8am to 8pm (EST)

Start a conversation

Magento

Overview

SalesPad now supports automated integration between Magento and Dynamics GP! 

With this integration, you can match GP Customers to Magento Customers, as well as create Customers, Contacts, and Sales Documents in GP via Magento.

The integration settings allow you to define how the Magento Customers and Contacts match the GP Customers and Contacts. Additionally, the settings allow you to define exactly how to import Magento Orders, creating GP Sales Documents.

Throughout this documentation, we will go over all of the different settings involved in this integration, how they function together, and how you can set them up to best fit your needs.


Customer and Order Integration

Standard Settings

Number Of Orders To Import - Specify the number of orders to import at one time.

This will be the page size for each API call when retrieving orders to be imported at each step of the Automation Agent job cycle. The API will be called until the last page returns less than the page size, at which point, all orders retrieved from each page will be processed.

Multiple Potential Customers Scenario - Review Queue - Queue that contains orders where a definitive customer match couldn't be found due to multiple possibilities being present. By default, the order will take the customer created first, then the order will be moved to the Workflow Queue designated by this setting to be reviewed.

When multiple Customers, Ship To’s and/or Bill To’s could satisfy the Matching criteria, the order will still be created for the customer that was first created in GP. This is helpful for identifying duplicated Customers or Contacts within GP.

Forward Document After Import - If Enabled, the imported order will be forwarded in workflow after being saved.

Named Notes Tab for Magento Order Comments - Specify which tab to import Magento order comments to on the Sales Document.

Import Orders in State - Select the Order States that should be imported from Magento.  Leave blank for all.

Import Orders in Status - Select the Order Statuses that should be imported from Magento (can use custom status set up in Stores -> Settings -> Order Status).

Update Magento Order Status After Import - After an order is imported into SalesPad, update the Order Status in Magento. Can use custom status set up in Stores -> Settings -> Order Status.

Flag Comment For Imported Order - Create a comment to send to a Magento order when the document is imported.


Expressions Overview

Several settings allow using expressions in order to match external and internal entities or assign values from external to internal entities.

Each settings expression editor can have different source objects, depending on usage. Here is an example of our default expression for Customer Bill To Assignment Mapping - Contact_Person



We use the “Concat” function to append the Magento Customer First and Last name together to be written into the GP Customer Address Field Contact_Person.

These editors are designed to be flexible enough so that you can change the expression to accommodate your needs. In addition to using the source object fields to assign values, we can also hardcode values to be assigned during object creation.


Here is an example from Customer Assignment Mapping - Currency_ID 

In this case, all customers will be created with the Currency ID = Z-US$



You can also write expressions that have IIF conditionals in them, as well as comments to help keep things nice and organized.


For more examples of different expressions, please refer to this Documentation.


Matching Settings

These settings use Expression Editors to allow you to create custom matching criteria to determine how you would like to match a Magento entity to a GP entity (Customer, Contact, or Item).

Each Matching setting can run one or more SQL queries to attempt to find a match in the GP database. These queries are executed one at a time in order of Priority (lowest to highest). If an earlier priority query returns a result, that result will be returned to be used in the import, and the subsequent priorities will not execute (see default examples of Customer Ship To Matching and Customer Bill To Matching).

The diagram below illustrates the sequence in which we attempt to match a GP Customer, Ship To, and Bill To each time a Magento Order is imported. 



Customer Matching

This is where you will define the mappings for looking up the Customer. This setting is used as the first attempt to match a GP Customer to the Magento Customer. If a customer is found in this step, its Customer Number will be used as part of the search criteria for looking up the Ship To and Bill To Addresses. 

The default settings attempt to match a GP Customer based on the email of the Magento Order (these matching criteria are "OR’d" together).



This Setting can be modified, and does not need to be populated since we can also match the customer indirectly via Customer Ship To Matching or Customer Bill To Matching.

For example, if you want to match your Magento Orders by shipping addresses instead, you can clear out the Customer Matching setting, and use the Customer Ship To Matching or Customer Bill To Matching settings to attempt to load the Ship To / Bill To and the Customer.

Customer Ship To Matching

This is where you will define the mappings for looking up the Customer Ship To Address. If we have matched a GP Customer via setting Customer Matching, that customer's 'Customer_Num' will be injected into the query for looking up the Ship To Address. Otherwise, we will attempt to match the Shipping Address across all GP Customers. If a Shipping Address match is found, and we did not yet find a customer, we will load that customer to be used for the import.

The default settings attempt to match a GP Shipping Address in three different steps.

Priority 1

Address: Attempt to find a match based on Address Line 1, City, State, and Zip. This criteria is all "ANDed" together.

Priority 2

Contact: Attempt to find a match based on the First and Last Name of the Magento Customer or Magento Shipping Address.

Priority 3

Primary Address: Attempt to find a match based on the Primary Address for the Customer. This assumes that the Customer was matched via Setting: Customer Matching.


Customer Bill To Matching

This is where you will define the mappings for looking up the Customer Ship To Address. If we have matched a GP Customer via Setting Customer Matching or Customer Ship To Matching, that customer's 'Customer_Num' will be injected into the query for looking up the Bill To Address. Otherwise, we will attempt to match the Billing Address across all GP Customers. If a Billing Address match is found, and we did not yet find a customer, we will load that customer to be used for the import.

The default settings attempt to match a GP Billing Address in three different steps.

Priority 1

Address: Attempt to find a match based on Address Line 1, City, State, and Zip. This criteria is all "ANDed" together.

Priority 2

Contact: Attempt to find a match based on the First and Last Name of the Magento Customer or Magento Shipping Address.

Priority 3

Primary Address: Attempt to find a match based on the Primary Address for the Customer. This assumes that the Customer was matched via Setting: Customer Matching.


Item Master Matching

This is where you will define the mappings for matching Magento items to a GP Item Master. Each Magento Line Item will use this Setting to find the corresponding GP Item.

The default settings attempt to match a Magento Sku directly to a GP Item Number.


Mapping Settings

These settings use Expression Editors to allow you to define how Customers, Orders and Sales Lines will be created.

Our target objects will be GP Customers, Contacts, Sales Documents, or Sales Lines. Our source objects will be Magento Customers, Contacts, Orders and Line Items.
Each Mapping contains a grid of all the target fields, and an expression for each that will set the field. There are many fields that have default expressions in the Suggested categories.

Customer Assignment Mapping

This is where you will define the mappings to be used when creating a new Customer. If we were unable to match an existing GP Customer with our Matching Settings, we will create a new GP Customer using the values in Customer Assignment Mapping.

Some necessary fields for creating a GP Customer are: Currency_ID, Payment_Terms, Sales_Person_ID, and Sales_Territory.



Once these fields are set, the integration will be able to create new GP Customers.

Customer Ship To Assignment Mapping

This is where you will define the mappings to be used when creating a new Customer Ship To Address. If we were unable to match an existing GP Customer Address with our Matching Settings, we will create a new GP Customer Address using the values in Customer Ship To Assignment Mapping.



Customer Bill To Assignment Mapping

This is where you will fefine the mappings to be used when creating a new Customer Bill To Address. If we were unable to match an existing GP Customer Address with our Matching Settings, we will create a new GP Customer Address using the values in Customer Bill To Assignment Mapping.



Sales Document Assignment Mapping

This is where you will define the mappings to be used when creating a new Sales Document. When the Magento Order is imported, this setting will be used to set each of the Sales Document fields.

Some necessary fields for creating a GP Sales Document are Sales_Batch and Sales_Doc_ID



Sales Line Assignment Mapping

This is where you will define the mappings to be used when creating a new Sales Line Item.

There are not any default expressions within this setting. We are setting the Item from Item Master Matching if a valid item was found. If an item was not found, an expression such as this could bring in the Sales Line Item as a non-inventory item (where "ZZ-" is the Non-Inventory Prefix).



We are setting some of these line items fields in the core code of the integration, though these assignments can be overridden with this setting.

Unit_Price, Markdown_Amount, Tax_Amount, Funct_Tax_Amount


Scripts

Sales Document Pre Import Script

A C# Script that runs before a Sales Document is imported.

Parameters: System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd

This script is the first thing to run when importing a Magento Order. At the time of execution, no assignments have been done either in code, or from expression editors. This script can be used to cancel the import early via setting "ce.Cancel = true", or through some preliminary assignments to the "SalesPad.Bus.SalesDocument sd".

New Customer Creation Script

A C# Script that runs after a new customer is created and before it is saved.

System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd, SalesPad.Bus.Customer customer

This script will run before a new customer is saved for the first time. This script runs after the assignments from Customer Assignment Mapping, but before the assignments from Customer Ship To Assignment Mapping and Customer Bill To Assignment Mapping.

The script can be used to do more complex assignments, or cancel the import under certain conditions by setting "ce.Cancel = true".

Sales Document Pre Save

A C# Script that runs just before a Sales Document is saved.

System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd

After this script runs, the document is saved. This script is the last opportunity to adjust values, or cancel the import by setting "ce.Cancel = true".




Inventory Export

Export Items, Price Levels, and Inventory Levels from GP to Magento. Allows flexibility to specify exactly which items and associated values are pushed to Magento.


Inventory Export - Matching

Product Export Filter

This is where you will define the criteria for which GP Item Numbers should be exported to Magento. If left blank, all items will be exported.

Create only one record within the left grid and define which items should be exported on the right. 

In this case, the system will export all items that start with HD-



Inventory Level Filter

This is where you will define the criteria for which GP Item/Site values should be exported to Magento. If left blank, no inventory level quantity will be exported. Only one GP Site will be used per Magento product, regardless of if the filter returns multiple GP locations.

The Inventory Level will be loaded once per Item being exported. 

The following example expression will export the summary inventory record for each item.


Item Price Lists Export Filter

This is where you will define the criteria for which Item Price Lists should be exported to Magento. If left blank, no price lists will be exported.

Create only one record within the left grid and define which price lists should be exported on the right.

We recommend that you only export one Price List entry per: Item, Quantity, Price Level. These price levels are loaded per Item that is to be exported. So in our clause, we want to only load Price Levels that match our Item Number. Also, since Magento does not have a concept of UofM - we are only loading Price Lists for our base UofM. 

Since we are in a multi-currency company, we will also only send price levels for a single Currency ID.

Finally, we are only sending 2 different Price Levels to Magento (Retail and Engineer)



For our HD-20, we will only export 3 of all of the Price Levels.


SalesPad


Magento


Product Item Master Matching

This setting will be used to try and match every Magento item to a GP Item. If a match is found, the GP Item will be used to update the Magento product.

The default matching for this is to match the Magento Sku to the GP Item Number. If this editor is not robust enough, the Setting: Product Item Master Matching Script can also be used to load a GP Item Number.



Assignment Settings

Product Mapping

This is where you will assign the Magento product fields from the GP Item and Location Masters.

The default calculation should account for any existing shipment quantity that is already on the Magento order.



Inventory Level Mappings

This is where you will assign the Magento Stock quantity from the GP Inventory Location defined in Inventory Level Matching.



Item Price Level Mappings

This is where you will assign the Magento Tiered Price fields from the GP Item Price Lists that were loaded via the definition in Item Price Lists Export Filter. A GP Price List should be mapped to a single Magento Customer Group.



Product Assignment Custom Field Mapping

This is where you will assign values to Magento custom attributes.

Create each Named group and specify the Magento Attribute Code and the field assignment. This will create new attributes or update existing attributes on each item.





Exporting Item Images

Item images can be exported by the Inventory Export component or the Inventory Image Export component. The Item Image UDF settings must be configured in order to export images.

Inventory Export

Item images will be automatically exported by the Inventory Export component. To improve performance, you can disable this functionality by setting the Export Images During Inventory Export setting to "False".

Inventory Image Export

Item images can also be automatically exported by the Inventory Image Export component. Unlike the Inventory Export component which exports the entire item, the Inventory Image Export component only exports item images.

The following settings must be configured for this component to work properly:

  • Item Image UDF

  • Product Item Master Matching

  • Product Export Filter

Note: This component can only export images for items/products that already exist in Magento


Scripts

Product Item Master Matching

A C# Script that can be used to match a GP item based on the Magento Item. This runs after an evaluation has been made with the setting: Product Item Master Matching.

Product Pre Export Script

A C# Script that runs before a Product is exported to Magento.




Order Export

GP Orders that were created via the Magento Order Import integration can export their tracking numbers and fulfillments back to Magento with the Magento Order Export component.

This component will target a certain GP batch of documents. Each document will use the link that was created during the order import to call the Magento API and update the appropriate document.

Standard Settings

Export Queue - Queue that contains orders ready to be exported to Magento.

Orders that were imported from Magento will need to be directed into this queue, where they will wait to be processed before being forwarded in workflow.

Export Failure Queue - In the event of an unsuccessful export, the document will be placed into this queue.

If for any reason there is an exception during the order export process, the document will be moved to this queue, and the error will be logged to the Automation Agent Action Center.

Number of Orders To Export - Specify the number of orders on each page of the order export.

This setting is to minimize the number of orders that are attempted to be loaded and processed at the same time.

Tracking Update Comment - Comment to be used when uploading tracking information.

Tracking Update Comment Visible On Front - Sets Visible On Front value for comment.  Used only if 'Tracking Update Comment' has a value.

Tracking Update Notify - Have Magento notify customers of tracking updates.


Matching Settings

Item Master Matching

This is where you will define the mappings for matching Magento items to a GP Item Master. Each Magento Line Item will use this Setting to find the corresponding GP Item.

The default settings attempt to match a Magento Sku directly to a GP Item Number.


Assignment Settings

Shipment Item Mapping

This is where you will define the mappings for exporting shipment item information. 

The default calculation should account for any existing shipment quantity that is already on the Magento order.

Tracking Number Mapping

This is where you will define the mappings for exporting tracking information.


Scripts

Order Export Pre Submission Script

A C# Script that will execute prior to sending tracking info to Magento.


Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Christian Hartford

  2. Posted
  3. Updated

Comments