Sei sulla pagina 1di 9

How to: What is an external shipping carrier and how to map a delivery mode to it?

Further reading
Microsoft Dynamics AX 2012 for Developers [AX 2012] SDK Download

What is an external shipping carrier?


An external shipping carrier is a shipping provider external to AX (for example FedEx, UPS, etc.). An external shipping carrier is modeled as a shipping adapter inside commerce runtime. Whenever any extra information which is not available within AX and is specific to a carrier is required by CRT, a call to the external shipping adapter is made. It is best understood with the following examples: 1. Instead of a flat shipping rate agreement, the retailer needs to get customized rates for each individual package from the shipping carrier. 2. A seller wants to display the latest tracking information (available from the shipping carrier) of the customers order shipments. 3. Before a seller accepts an order, they want to know if the destination shipping address entered by the customer is supported by the specific shipping carrier selected. Items are shipped to a buyer based on the mode of delivery. The mode of delivery is the means of transportation that is used when an order is delivered from the seller to the buyer. To associate a means of transportation to a specific carrier, we must map the mode of delivery to the shipping carrier within AX.

Creating the shipping carrier account within AX


1. Open Carrier company form via Inventory and Warehouse Management Setup Shipping Carrier Carrier Company

Figure 1. Forms required for setting up shipping carrier account.

2. Click on New to add a new carrier.

3. Add the minimum required fields such as Carrier name and general Charges.

Figure 2. Minimum required fields for a new Carrier Company.

4. On the Accounts fast tab, click on Add. 5. Add Account Code and Carrier Account Number along with currency. (The sample carrier adapters provided in CRT do not use these fields except for currency.)

Figure 3. Click on Configuration after entering Account Code and Account Number.

6. Click on Configuration. 7. The Carrier Account Configuration form is a table of option name and option value pairs that can be used to specify any values that are required for the external carrier adapter in CRT to function. Example values would include: web service URL of external shipping carrier, log in credentials for web service, etc. Sample values are show in figure X.

Figure 4. Name value pairs are used to specify Carrier Account Configuration.

Figure 5. Sample Carrier Account Configuration for OOB FedEx adapter.

Creating a unique identifier in AX for every shipping adapter in CRT


Each external shipping adapter inside CRT is uniquely identified by the Name property of the IShippingCarrier interface that is implemented by every shipping adapter. The above information is reflected in AX inside the RetailShipCarrierInterface table. Every shipping adapter registered in CRT is represented as a row in RetailShipCarrierInterface. To register a new shipping adapter in AX, add the name and description for the adapter in the RetailShipCarrierInterface table.

Note: There is no form in AX that directly exposes the RetailShipCarrierInterface table.

Additions can be made to the table using the following sample AX job code:
static void AddRetailShippingCarrier(Args _args) { RetailShipCarrierInterfaceId carrierAdapterId = 'Contoso'; str carrierDescription = "Contoso Shipping Adapter"; RetailShipCarrierInterface loc_RetailShipCarrierInterface; ttsBegin; select forUpdate loc_RetailShipCarrierInterface where loc_RetailShipCarrierInterface.CarrierAdapterId == carrierAdapterId; if (loc_RetailShipCarrierInterface.RecId == 0) { loc_RetailShipCarrierInterface.CarrierAdapterId = carrierAdapterId; loc_RetailShipCarrierInterface.Description = carrierDescription; loc_RetailShipCarrierInterface.insert(); } ttsCommit; }

Code 1. Sample job code for inserting entries in RetailShipCarrierInterface table.

Mapping an AX shipping carrier account to a CRT shipping adapter


The association between an AX shipping carrier account and a CRT shipping adapter is made inside Carrier Ids form. 1. Open Carrier Ids form by navigating to Inventory and Warehouse Management Setup Shipping Carrier Carrier Ids 2. Click on new to add a new carrier id. 3. Assign an unique carrier identifier in Carrier Id column 4. Provide a description of the carrier service. 5. Choose a company account that you want to associate with this carrier id.

6. From the RetailInterfaceId column dropdown list, choose the external shipping adapter in CRT that you want to associate with this carrier identifier.

Figure 6. Map Carrier ID to Retail Carrier Interface ID which is the same as the name of an external shipping adapter in CRT.

7. Close the form.

Mapping a delivery mode to a carrier id


1. Open the modes of delivery form via Sales and Marketing Setup Distribution Modes of Delivery.

Figure 7. Modes of Delivery form.

2. Select a pre-existing delivery mode or create a new one. (For more information on creating delivery modes please refer to the related how-to). 3. Under Setup fast tab, choose Ground or Air from the Services drop down list. This should enable the Carrier ID field below. 4. Now choose the carrier id that was created earlier in this how-to. This will automatically populate the Carrier Company and Account Code fields. 5. If multiple accounts are associated with Carrier Company, then choose the correct account code that has the associated adapter configuration. 6. Close the form.

7. Navigate to Retail Periodic Data Distribution.

Figure 8. Process Delivery Modes and Create Actions.

8. Click on Process Delivery Modes. Press OK. 9. Click on Create Actions. 10. Now push the latest configuration down to CRT database by running A-1120_OC/N-1120_OC synch jobs.

Figure 9. Push adapter configuration down to CRT database.

11. The following tables must be synced for the latest configuration to be visible to CRT: a. RetailShipCarrierAccountConfiguration b. ShipCarrierCompanyAccounts c. RetailShipCarrierInterface d. ShipCarrierTable e. DlvMode

Potrebbero piacerti anche