on 06-16-2016 12:16 PM
Hi,
I've created a new custom BO and added a validation in script 'OnSave', this is very simple, when ELEMENT1 == "TEST" then throw an error message "TEST not valid" and return False. Afterwards I've created a Web Service to create, update and read this BO.
All the operations work fine but when I test my validation (sending ELEMENT1 = "TEST" in create or update operations), as expected, the entry is not created in the BO, but I do not get any error message, the Log element is always empty.
Why don't I get my custom error message in the response?
For standard validations, Log element contains the error message, for example:
<Log>
<MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
<Item>
<TypeID>015(/AP_ESI_COMMON/)</TypeID>
<SeverityCode>3</SeverityCode>
<Note>Instance with the same key (1605) already exists</Note>
</Item>
</Log>
Thanks,
Alejandro Cordero.
I believe it works.
The problem here is that the unique standard validation "Instance with the same key (1605) already exists" runs before your custom validations. That's why you cannot see it in the response.
Try creating an entry with a different key and see if your validations show up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernando,
Sorry, maybe I wasn't clear. I included that XML only to show that when there is a standard error the Log element is populated.
This is the response I get when I throw my custom error (the entry is not created).
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<n0:MyCustomBO_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:LFW:/1SAI/TA234234234234234234234:804">
<Log/>
</n0:MyCustomBO_sync>
</soap-env:Body>
</soap-env:Envelope>
Thanks,
Alejandro.
Hi,
I guess save messages won't be part of webservice response.
You could put the same validation in AfterModify.
Thanks, Pradeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.