How to check if the LineItems are found


How to check if the LineItems are found or not?


You can check it using Script Rule on the Invoice Document Definition level:

if (Context.Field("LineItems").Items.Count == 0)    
    {Context.CheckSucceeded = false;
    Context.ErrorMessage = "NO LINEITEMS FOUND";

Since the Script Rule needs a trigger to be executed, it should contain an existing field. So, if the LineItems were not found, the script will not run.

In order to make it work as expected, any existing field should be added to the rule (PONumber field in the example below):


Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.