mitchspano/trigger-actions-framework

Invalid formula reported as Invalid Subtype

Closed this issue · 1 comments

When formula in Entry Criteria is invalid and doesn't compile, this is not reported as invalid formula but as INVALID_SUBTYPE.

FormulaFilter:159

Good catch! Thanks for bringing this to my attention @pkozuchowski.

It turns out that Formula.builder().build() throws System.FormulaValidationException in multiple scenarios:

  1. The defining class for the input type is not global
  2. The formula is syntactically invalid

Ideally, we would delineate between these two cases with their own messages, but that's not possible.
I will need to update the FormulaFilter class getFormulaInstance method to ensure that is throws a robust enough error message which encompasses both scenarios.