How to make invoices stop at Verification if Line Items table has no rows?


I would like invoices that do not have any line items to throw an error and stop at the Verification stage. Currently, they are all skipping it if there are no uncertain characters or any other rule errors. How can I achieve that?


It is possible with the script rule that would check that the Line Items are not completely empty (0 rows). To do it:
  • Add a new script rule in Document Definition Properties > Rules > owned by Invoice > New Rule:
  • Add the LineItems field and some of the header fields (i.e. Invoice Number), so the rule could be triggered:

  • Below is a sample script:​
if (Context.Field("LineItems").Items.Count == 0)
    Context.CheckSucceeded = false;
    Context.ErrorMessage = "Line Items are empty.";

  • Save and publish the document definition.

After that, invoices with empty LineItems will throw the error and will stop at the Verification.

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.