Integration»Post Shipment

Post Shipment

Creating Post Shipment Scripts

By creating script in your database, you can easily pull back ship results with little effort. Simply create fields in your table for the data you'd like to store, and then pull from the following NRGship fields after calling the "External - Ship" script:

Response_ShippingTrackNumber.t
Response_PublishedRate.n
Response_NegotiatedRate.n
Response_BilledWeight.n
Response_OptionsCharge.n
Response_Status.t [New Shipment|Shipped|Delivered|Voided|Exception]

If you wanted to get all unique track numbers you could use a Custom Function like GetNthRecordSet with GetNthRecordSet ( Packages::Response_ShippingTrackNumber.t ; 1 ; 100)

Run User Script

If you have selected User Script as the Post Ship Script option in preferences, the "Post-Shipment User Script" in the "ShipManager_Data" file will get called. This script is passed the _pk_ShipManagerID value so that the newly shipped record can be processed.

The default script here does a Find on the Ship table to find the record that just shipped. What we suggest here is you then call an external script in YOUR database, nnd pass the UserField_ID to your script for further processing.

Alternatively, you could add an External Data Source in the ShipManager_Data file back to your database, you can then pass information back by adding a relationship from "UserField_ID" (In the ship table) to your Primary Key but this makes future updates of NRGship a little more cumbersome as you have to add the datasource and rebuild the relationship.

Once you have created the relationship to your data, you can modify the "Post-Shipment User Script" so that it sets values in your table so that shipment data is automatically recorded. Below are the most common fields in NRGship that you would pass back to your system.

Response_ShippingTrackNumber.t
Response_PublishedRate.n
Response_NegotiatedRate.n
Response_BilledWeight.n
Response_OptionsCharge.n
Response_Status.t [New Shipment|Shipped|Delivered|Voided|Exception]

You may also want to update your tables with the final values for Carrier and Service in case the shipping clerk makes changes after you set the values.

NOTE: Not all response fields may have values.