Introduction

Spindle Self Serve can provide customers to a link to track their consignments online.

Requirements

To allow the link to be built, the tracking reference number and if multiple courier firms are used, a code for each courier must be added to the SOPOrderReturns table in Sage 200. This is outside the scope of this document and must be configured by the business partner.

The couriers used must have a consignment tracking website that can accept the reference no in its URL

Example Configuration

The exact settings needed for any given site will differ according to how the courier operates, where in the table the data is stored and so on. 

We will use TNT Express as an example:

When we enter a tracking reference in the search field we can see the URL contains our number:

The URL being 

https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=12345678

Let us also assume that Sage 200 is configured so that the tracking reference no is saved into AnalysisCode20

With this we can now set up Spindle Self Serve:

  • Log in as the Spindle Self Serve admin
  • Under Sage>Modules, check the option for 'Tracking'

  • Under Advanced>Courier Tracking enter the following code:
Case
 When isnull(SOP.AnalysisCode20,'') = ''
 Then NULL
 Else 'https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=' + SOP.AnalysisCode20
End 

We use a CASE statement here so that if the tracking reference is not added, the button does not show.

This code can be thought of as the middle section of the following SQL query

SELECT
Case
 When isnull(SOP.AnalysisCode20,'') = ''
 Then NULL
 Else 'https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=' + SOP.AnalysisCode20
End
FROM SOPOrderReturns as SOP WHERE DocumentNo = SOP.DocumentNo 

With a SELECT and the FROM clauses being encoded in Spindle Self Serve.

If the customer uses multiple couriers, we will need a method to distinguish between them. Let us say that AnalysisCode19 contains a Courier code (eg TNTexpress, DHL, RoyalMail etc...)

We can test against that value as well with code such as

Case
When isnull(SOP.AnalysisCode20,'') = ''
Then NULL
When isnull(SOP.AnalysisCode20,'') <> '' AND SOP.AnalysisCode19 ='TNTexpress'
Then 'https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=' + SOP.AnalysisCode20
When isnull(SOP.AnalysisCode20,'') <> '' AND SOP.AnalysisCode19 ='DHL'
Then 'https://www.dhl.com/global-en/home/tracking/tracking-global-forwarding.html?submit=1&tracking-id=' + SOP.AnalysisCode20
Else
Then 'https://www.royalmail.co.uk/track-your-item/tracking.html?searchType=con&cons=' + SOP.AnalysisCode20
End

Knowledge Base Article Details

Related ProductSpindle Self Serve
Reference NumberKBA-09-02-001 
Document Date24/03/2021
Original AuthorVince Hodgson
Document Version1.0
Last Updated24/03/2021
Update Author Vince Hodgson