NetSuite natively supports direct shipping integration with but UPS and FedEx, which allows users to print shipping labels for a wide variety of service levels for each carrier from within the NetSuite UI. To expand upon those capabilities, NetSuite also supports the integration of third-parting shipping platforms that connect to hundreds of other carriers, such as USPS, DHL, and even LTL and large freight transportation providers. These integrations allow for shipment information to be passed back into NetSuite automatically, however the standard functionality that converts UPS and FedEx tracking numbers into links does not work with any other carriers.
The Solution
Start by creating a custom transaction body field by navigating to Customization > Lists, Records, & Fields > Transaction Body Fields > New. Set the Label, ID, and Description fields as desired, leaving Type set to Free-Form Text and Store Value checked.
On the Applies To subtab, check the Sale box to allow this field to be displayed on sales order records.
Use the Display subtab to define where the field should be displayed and add help text to let users know what this field does. Additionally, set the Display Type as Inline to prevent users from accidentally editing or deleting the tracking link.
This next step is where the magic happens. You’ll define your formula on the Validation & Defaulting subtab, by placing it in the Default Value section. Make sure that the Formula box is checked to allow the system to display the information correctly in the custom field.
The formula that you will enter will vary based on the carriers that you need to include, but this same format can be applied to practically any carrier. This formula may look a bit complicated, but it’s actually quite straight-forward once you understand the structure. Here’s a sample:
CASE WHEN {fulfillingtransaction.shipmethod} LIKE ‘FedEx%’ THEN ‘<a href=”https://www.fedex.com/apps/fedextrack/?tracknumbers=’||{linkedtrackingnumbers}||’&language=en” target=”_blank”>’||{linkedtrackingnumbers}||'</a>’
WHEN {fulfillingtransaction.shipmethod} LIKE ‘UPS%’ THEN ‘<a href=”http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&Requester=UPSHome&WBPM_lid=homepage%2Fct1.html_pnl_trk&trackNums=’||{linkedtrackingnumbers}||'” target=”_blank”>’||{linkedtrackingnumbers}||'</a>’
WHEN {fulfillingtransaction.shipmethod} LIKE ‘Canada Post%’ THEN ‘<a href=” https://www.canadapost.ca/trackweb/en#/details/’||{linkedtrackingnumbers}||'” target=”_blank”>’||{linkedtrackingnumbers}||'</a>
WHEN {fulfillingtransaction.shipmethod} LIKE ‘DHL%’ THEN ‘<a href=”http://www.dhl.com/en/express/tracking.html?AWB=’||{linkedtrackingnumbers}||’&brand=DHL” target=”_blank”>’||{linkedtrackingnumbers}||'</a>’ WHEN {fulfillingtransaction.shipmethod} LIKE ‘USPS%’ THEN ‘<a href=”https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=’||{linkedtrackingnumbers}||'” target=”_blank”>’||{linkedtrackingnumbers}||'</a>’ ELSE null END