ERROR

ERROR(string);

he ERROR operator is used to explicitly trigger an error in a formula when a certain condition is met. It prevents further execution of the formula and returns a specified error message, typically to inform the user about what went wrong. Generally, using this function, you can force a transfer to end with a specific error message.

Formula components: 

IF(EQUALS("Some_Field",'ValueA'),ERROR("Some_field has value A - stopping transfer"),'')+"Some_Field"


The formula will normally just return the value of the field "Some_Field", but if the fields value is 'ValueA' then the whole transfer will stop and this error message will be logged.

Example:

##BLANKVALUE(LSLOOKUP('%%LSITEM%',"No"),ERROR('Item No. not found: '+"No"))


Formula Breakdown:

The formula will search for the No value in the Link Storage. If the value is found, the No will be retrieved. If there is no value found then the error messagge will be displayed in the the Logs and the transfer will stop. 

Example Behavior

  • Scenario 1: LSLOOKUP finds a value for "No"
    • The lookup succeeds, and the value found in '%%LSITEM%' is returned.
    • No error is triggered.


  • Scenario 2: LSLOOKUP returns blank or a NULL value for "No"
    • The formula evaluates the second argument of BLANKVALUE.
    • The ERROR function is triggered, displaying a message like: Item No. not found: 12345