If you ever have a situation where you receive a similar error printing a SOP form, “Inconsistent restriction/sort expression: Please add the following restriction: D00590statement na= D00590statement na",  this might be the blog for you! 

ISSUE:  Printing a modified SOP blank historical Invoice form gave the following error: “Inconsistent restriction/sort expression: Please add the following restriction: D00590statement na= D00590statement na"

As most of you know you’ll typically receive this error message after modifications have been made to a report, especially if additional files are linked or additional fields have been added to the report.  The message usually includes a restriction that must be added.  To resolve this problem, click Tables in the Report Definition window. Look for the table that is marked with an asterisk (*) and that is on the lowest level. The levels are defined by the number of dashes next to the table. Close this window, and then click Restrictions in the Report Definition window. Add a restriction that sets a field from this table to be equal to itself.  This typically resolves the error.

However, in my customer’s situation that restriction already existed!  After getting the package file and importing in the form, I was able to replicate the error.  I noticed some strange table relationships that existed (compared it to the original report) and I couldn’t build that type of relationship when trying to recreate the relationships on the unmodified form.  After further testing I noticed the strangest thing.  After importing the modified SOP blank historical form, NONE of my unmodified SOP forms  (SOP Long, short other historical forms) would work.  I was receiving similar errors. 

CAUSE – There was a bad Relationship between two tables that was on the SOP blank historical form. I fixed that and all reports (modified and unmodified) stopped receiving the error.

ACTION: I started to review EACH table RELATIONSHIP and when I opened up one of them I receiving the following error: "This relationships was improperly defined. If you continue to use it in its present form, your report may not generate with the correct results". I knew this was my culprit.  To fix it all I had to do was open the relationship and resave it.  After resaving the relationship the error was gone.  Also,  when I looked at the table linking after fixing the relationship, the linking now appeared correctly.

Hope this is helpful when troubleshooting those Inconsistent restriction/sort expression errors!

Thanks,

Angela Ebensteiner

SR Technical Advisor