Use Null Checks for Optional Attributes

Among the transaction attributes used in rule conditions, there might be some attributes which are optional during transaction entry.

When creating rules using such optional attributes, it's recommended to include a null check condition. This ensures that rule evaluation doesn't fail for transactions which have no value entered for such optional attributes.

For example, for an approval rule condition using Purchase Order Number attribute for Payables Invoices:

InvoiceHeader.Purchase Order Number startsWith ABC

Add a null check condition to cover those invoices which don't have a purchase order number referenced on them.

InvoiceHeader.Purchase Order Number != null

It happens quite often that the user doesn't enter any value for an optional attribute on the UI. If an optional attribute is used in the approval rules, it will lead the server to throw a null pointer exception. The application will reject the transaction when such a rule is executed. It is highly recommended to include a null check operation wherever optional attributes are used.