How to Retrieve Tracking Number for an Order from Notes

How to Retrieve Tracking Number for an Order from Notes

Release Date: 12/13/2017

Q - Can you let me know how the tracking number is stored in Elliott so I can use query to retrieve the information?

A - Regarding how Elliott stores tracking numbers, please refer to the following Knowledge Base article:


You can retrieve the tracking number by using the SQL SELECT statement as follows:

SELECT * FROM NOTES
WHERE NOTE_FILE_NAME = 'CPORDHDR' AND
NOTE_FILE_REF_NO = RIGHT(CONCAT('000000',CONVERT(#ORD_NO#,SQL_CHAR)),6) AND
NOTE_CREATE_BY_USER = 'STARSHIP';

Substitute the #ORD_NO# with Elliott's order number.  We assume #ORD_NO# is in numeric or integer format. Keep in mind we store order numbers with padded leading zeroes in NOTE_FILE_REF_NO to 6 digits. That is to say, order# 1234 is stored in 001234 in NOTE_FILE_REF_NO, which is a string field. So the RIGHT(CONCAT('000000',CONVERT(#ORD_NO#,SQL_CHAR)),6) will pad leading zeroes to #ORD_NO# and make it a string value to match the data type of NOTE_FILE_REF_NO.

Also, keep in mind that some users' nightly deferred processing routine will post and purge invoiced orders and move them to invoice history. So the above procedure may only work from the time that the order is manifest (during the day) to the time when the order is posted and purged (somewhere around midnight). After mid-night, the order could be moved to two places: (1) Invoice History; (2) Order History. Invoice History is referenced by invoice number.

If you have the order number, then the Order History is a better candidate. So if the query above does not work, you will use the following query:

SELECT * FROM NOTES
WHERE NOTE_FILE_NAME = 'CPHODHDR' AND
NOTE_FILE_REF_NO = RIGHT(CONCAT('000000',CONVERT(#ORD_NO#,SQL_CHAR)),6) AND
NOTE_CREATE_BY_USER = 'STARSHIP';

If you have the invoice number, then the invoice history is a better choice. So you can use the following query:

SELECT * FROM NOTES
WHERE NOTE_FILE_NAME = 'CPINVHDR' AND
NOTE_FILE_REF_NO = RIGHT(CONCAT('000000',CONVERT(#INV_NO#,SQL_CHAR)),6) AND
NOTE_CREATE_BY_USER = 'STARSHIP';

The following Knowledge Base article may relate to you if you wish to join the NOTES and CPINVHDR table to retrieve both tracking and invoice header info:


EMK





    • Related Articles

    • Exported Tracking Number in CSV Shows Zeroes After the 15th Digit

      Release Date: 8/23/19 Version: All Q - When I go to COP -> Processing -> Print Pick/Pack Ticket & Lbls -> Shipping -> Manifest order Status Report, and I choose to export to CSV file, the CSV file has a tracking number column. When I open the CSV ...
    • Feature - Add Tracking Number to Shipped Data Export

      Release Date: 07/09/2021 Version: 8.5 & Up In COP -> Utilities -> Sales Order Export -> Shipped Data Export, the tracking number is added to the report. To keep the reports within the same space, the Misc. Charges & Sales Tax columns are taken out ...
    • Elliott V7.0 Release Notes: What's New Since Elliott V6.7

      What’s New Since Elliott V6.7 System Wide Features Macro & Office Automation Elliott will allow users to launch a menu item automatically from the command prompt. For example, EL700 02 0101 02 will startup Elliott and launch the A/R module, then ...
    • Feature - Add Ship Via and Tracking Number to Expanded Aging Report CSV

      Release date: 7/27/2021 Versions: 8.5 & Up The purpose of this feature is for payment collection. There's a need to find outstanding unpaid invoices with shipment tracking numbers to follow up the trading partners for payments. Two new columns, Ship ...
    • Feature - Delete Order Tracking Note When Void Completed VICS BOL

      Release Date: 10/11/19 Version: 8.5 and Up Currently, when a user uses VICS BOL and chooses to “Complete” the bill of lading, the tracking number of the bill of lading (Pro# or ARN#) can be written to the Elliott tracking note associated with the ...