<turbo-stream action="update" target="wiki_99_subpage_200_info"><template>
<h1>ERROR(string);</h1><p>he <code>ERROR</code> 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.</p><p><strong>Formula components:&nbsp;</strong></p><pre>IF(EQUALS("Some_Field",'ValueA'),ERROR("Some_field has value A - stopping transfer"),'')+"Some_Field"</pre><p><strong><br></strong>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.</p><p><strong>Example</strong>:</p><pre>##BLANKVALUE(LSLOOKUP('%%LSITEM%',"No"),ERROR('Item No. not found: '+"No"))</pre><p><br></p><h3><strong>Formula Breakdown:</strong></h3><p>The formula will search for the <strong>No</strong> 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.&nbsp;<br><br></p><h3><strong>Example Behavior</strong></h3><ul><li><strong>Scenario 1: </strong><strong><code>LSLOOKUP</code></strong><strong> finds a value for </strong><strong><code>"No"</code></strong><ul><li>The lookup succeeds, and the value found in <code>'%%LSITEM%'</code> is returned.</li><li>No error is triggered.</li></ul></li></ul><p><br></p><ul><li><strong>Scenario 2: </strong><strong><code>LSLOOKUP</code></strong><strong> returns blank or a NULL value for </strong><strong><code>"No"</code></strong><ul><li>The formula evaluates the second argument of <code>BLANKVALUE</code>.</li><li>The <code>ERROR</code> function is triggered, displaying a message like: <code>Item No. not found: 12345</code></li></ul></li></ul><p><br></p>
</template></turbo-stream>
<turbo-stream action="prepend" target="flash"><template></template></turbo-stream>
