OnError Handling

You can add an onError element to the callMethod request to take a specific action if an error occurs. The onError tag can specify an abort attribute that specifies whether all subsequent requests should be skipped. The allowed values are yes or no. A global onError tag can be specified as a child of the jdeRequest tag, which will be executed if errors were encountered and no other onError tag with abort='yes' was executed. The global onError tag should be the last request in the document.

<?xml version='1.0' ?>
<jdeRequest type='callmethod' user='steve' pwd='xyz' role='*ALL' 
environment='prod' session=''>
<callMethod name='myfunc' app='P42101' trans='t1' runOnError='yes'>
<params>
<param name='CostCtr'>    1001</param>
</params>
<onError abort='no'>
<endTransaction trans='t1' action='rollback'/>
</onError>
</callMethod>
</jdeRequest>
Note: If you are using XML CallObject with a standard named event rule (NER), you might not be able to use OnError handling. OnError handling considers errors based on the element returnCode = Return Value and depends on the jdeCallObject return value containing the error. A standard NER might use the system function Set NER Error to capture and return errors, but OnError handling does not have access to read errors set through the Set NER Error element.