Custom SmartList built in SmartList Builder works in SmartList, but gives an error in SmartView
By David Youngquist, Senior Support EngineerWednesday, August 13, 2014
Created a new SmartList in SmartList Builder. When I run the list in SmartList, it runs fine. However when I run the SmartList in SmartView I get either duplicate records, or I get some sort of SQL error.
Most of the time this is caused by either a bad table join, or incorrect data types on joins or calculated fields. Standard SmartLists go through Dexterity first, which then calls to SQL and retrieves the records. SmartView goes directly to the SQL table without going through Dexterity to get the data, which is why it’s faster.
SmartList is more forgiving of incorrect joins or mismatched data types because any SQL errors that get returned by SQL are handled at the Dexterity level. So views with bad joins that normally would return hundreds of duplicate records are filtered out to just 1 record in SmartList.
Put the following in the DEX.INI and relaunch GP
Relaunch GP and then open up the SmartList in SmartList Builder. Then Save the SmartList. When you save it, it will popup a text box that shows the SQL statement that is being run. Copy it out of there and paste it into SQL Server Query Analyzer and see what you get. If you get more or less records that the SmartList does, then SmartList is filtering out a bad join or SQL errors. If you get SQL errors, that will result in SQL errors in SmartView. The SmartList needs to be modified until the SQL statement you copy from the text box will run directly in SQL without errors.