HowTo MapDlvModeToExternalShipping

Embed Size (px)

Citation preview

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    1/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 eachindividual package from the shipping carrier.

    2. A seller wants to display the latest tracking information (available from the shipping carrier) ofthe customers order shipments.

    3. Before a seller accepts an order, they want to know if the destination shipping address enteredby 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.

    http://msdn.microsoft.com/en-us/library/hh881815http://msdn.microsoft.com/en-us/library/hh881815https://mbs.microsoft.com/partnersource/deployment/resources/productreleases/MicrosoftDynamicsAX2012.htmhttps://mbs.microsoft.com/partnersource/deployment/resources/productreleases/MicrosoftDynamicsAX2012.htmhttps://mbs.microsoft.com/partnersource/deployment/resources/productreleases/MicrosoftDynamicsAX2012.htmhttp://msdn.microsoft.com/en-us/library/hh881815
  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    2/9

    Creating the shipping carrier account within AX1. Open Carrier company form via Inventory and Warehouse Management Setup Shipping

    Carrier Carrier Company

    2. Click on New to add a new carrier.

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

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    3/9

    3. Add the minimum required fields such as Carriername 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 Codeand Carrier Account Numberalong with currency. (The sample carrieradapters 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.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    4/9

    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 CRTEach external shipping adapter inside CRT is uniquely identified by the Nameproperty of the

    IShippingCarrierinterface that is implemented by every shipping adapter.

    The above information is reflected in AX inside the RetailShipCarrierInterfacetable. 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.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    5/9

    staticvoidAddRetailShippingCarrier(Args _args){

    RetailShipCarrierInterfaceId carrierAdapterId = 'Contoso';strcarrierDescription = "Contoso Shipping Adapter";

    RetailShipCarrierInterface loc_RetailShipCarrierInterface;

    ttsBegin;

    selectforUpdate loc_RetailShipCarrierInterface whereloc_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.

    Additions can be made to the table using the following sample AX job code:

    Mapping an AX shipping carrier account to a CRT shipping adapterThe 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 SetupShipping Carrier Carrier Ids

    2. Click on new to add a new carrier id.3. Assign an unique carrier identifier in Carrier Id column4. Provide a description of the carrier service.5. Choose a company account that you want to associate with this carrier id.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    6/9

    6. From the RetailInterfaceId column dropdown list, choose the external shipping adapter in CRTthat 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.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    7/9

    Mapping a delivery mode to a carrier id1. 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 creatingdelivery modes please refer to the related how-to).

    3. Under Setupfast tab, choose Ground or Air from the Services drop down list. This shouldenable the Carrier ID field below.

    4. Now choose the carrier id that was created earlier in this how-to. This will automaticallypopulate the Carrier Company and Account Code fields.

    5. If multiple accounts are associated with Carrier Company, then choose the correct account codethat has the associated adapter configuration.

    6. Close the form.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    8/9

    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.

  • 8/13/2019 HowTo MapDlvModeToExternalShipping

    9/9

    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. RetailShipCarrierAccountConfigurationb. ShipCarrierCompanyAccountsc. RetailShipCarrierInterfaced. ShipCarrierTablee. DlvMode