Call Object Error Handling with Multiple Requests per Document

Maxim Ness

Active Member
Dear friends,

I am having some problems understanding the error handling of XML CallObject Method. The OneWorld XE Interoperability guide says:

“Multiple requests can be included in the XML document. By default, requests are not run if there have been any errors on previous requests. If a request should be run even if errors have occurred, then the default behaviour can be overridden by using the runOnError attribute on the request with a value of yes.”

I am testing this functionality in OneWorld XE sp 23 on Windows and can not simulate the noted above behaviour. Even thought a first Business function returns an error – the second one still gets submitted for the execution.
What I want is the following: if the first business function fails I want to stop/bypass the execution of the second business function. Here’s my code

<jdeRequest pwd='..' role='*ALL' type='callmethod' user='..' comment='' session='' environment='DV7333' sessionidle='1800'>
<callMethod app='SCHEDULER' name='F00095ReserveObject' runOnError='no' returnNullData='yes'>
<params>
<param name='szNameObject'>F4801</param>
<param name='szUserId'>MaAX01</param>
<param name='cSuppressErrorMessage'></param>
<param name='szErrorMessageID'></param>
<param name='szGenericKey'>45261</param>
<param name='szApplication'>SCHEDULER</param>
</params>
<onError abort='yes'></onError>
</callMethod>
<callMethod app='SCHEDULER' name='F00095ReserveObject' runOnError='no' returnNullData='yes'>
<params>
<param name='szNameObject'>F4801</param>
<param name='szUserId'>MaAX01</param>
<param name='cSuppressErrorMessage'></param>
<param name='szErrorMessageID'></param>
<param name='szGenericKey'>452614</param>
<param name='szApplication'>SCHEDULER</param>
</params>
<onError abort='yes'></onError>
</callMethod>
</jdeRequest>

And the response …

<?xml version='1.0' encoding='utf-8' ?>
<jdeResponse pwd='..' type='callmethod' user='..' session='3664.1264107667.5' environment='DV7333' sessionidle='1800'>
<callMethod app='SCHEDULER' name='F00095ReserveObject' runOnError='no' returnNullData='yes'>
<returnCode code='0'/>
<params>
<param name='szNameObject'>F4801</param>
<param name='szUserId'>MaAX01</param>
<param name='cSuppressErrorMessage'></param>
<param name='szErrorMessageID'></param>
<param name='szReserversNameAlpha'></param>
<param name='szGenericKey'>45261</param>
<param name='szApplication'>SCHEDULER</param>
<param name='szReserversApplication'>SCHEDULER </param>
<param name='cWarningError'></param>
</params>
<errors>
<error code='113C'>Error: Reserved by </error>
</errors>
</callMethod>
<callMethod app='SCHEDULER' name='F00095ReserveObject' runOnError='no' returnNullData='yes'>
<returnCode code='0'/>
<params>
<param name='szNameObject'>F4801</param>
<param name='szUserId'>MaAX01</param>
<param name='cSuppressErrorMessage'></param>
<param name='szErrorMessageID'></param>
<param name='szReserversNameAlpha'></param>
<param name='szGenericKey'>452614</param>
<param name='szApplication'>SCHEDULER</param>
<param name='szReserversApplication'></param>
<param name='cWarningError'></param>
</params>
</callMethod>
</jdeResponse>

Thank you!
 
Maxim,

I think in this case, the business function for reserving the object is not setting an error. It is calling another business function (B0000603) to set the text substitution error 113C, but even that function returns a success. For the OnError to be triggered the function needs to return an error. I remember we had to use "Set NER Error" on custom functions explicitly for it to work this way.

You can either try modifying the code in the function or instead of using the "OnError" condition, check for the value of szErrorMessageID.
 
Sachin,

Thank you for your comment. I will do some more testing with other BSFN's.
 
Back
Top