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

    • Feature - Import of Shipment Tracking Number for Sales Order Through CSV File

      Release date: 5/19/2020 Revised: 7/26/24 Version 8.5 and Up You can now import shipment tracking numbers for sales orders through a CSV File. You can find the utility in COP, Processing, Print Pick/Pack Tickets & Lbls, Shipping, and Tracking Number ...
    • How Do I Purge Notes?

      Release Date: 3/1/2024 Q: The Note file is very large. How do I purge old records? A: Purging can be a double-edged sword, so you should be very careful when purging. The first step we recommend is to backup your data. Backup Your Data It is ...
    • 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 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 ...
    • Feature - Tracking Number Import 3rd Party WMS and Event Support

      Release Date: 9/5/23 Version: 8.5 and Above If the 3rd Party WMS or Logistic Support is enabled, the first time a user runs the Customer Order Processing-> Processing-> Print Pick/Pack Ticket & Lbls-> Shipping-> Tracking Number Import application the ...