ORDER BY clause in SmartFill Custom SQL Script not Ordering

Issue

When you add an ORDER BY clause in a custom SQL script for SmartFill, it does not display the order from the clause.

Resolution

You may use a custom SQL script to display records for a SmartFill Lookup. When you add an ORDER BY clause to your custom SQL script, it won’t have any effect on the order in which the results display in the Select Record window. The purpose of the stored procedure is to insert records into the SF001 table.  This table is used to display the results in the Select Record window.  The order the results initially display will always be by the first column listed.