We have an external system integrated with our Salesforce and Case records get upserted from external system to Salesforce using SOAP API.
When Case records are successfully upserted, the response received by external system is similar to below and it passes the Case Id in its response:
<soapenv:Body>
<upsertResponse>
<result>
<created>false</created>
<id>500W0000006cfj4IBC</id>
<success>true</success>
</result>
</upsertResponse>
</soapenv:Body>
But if case records fail to update due to a custom validation error, the response is similar to below and no Id is returned:
<soapenv:Body>
<upsertResponse>
<result>
<created>false</created>
<errors>
<message>Validation Error Message</message>
<statusCode>FIELD_CUSTOM_VALIDATION_EXCEPTION</statusCode>
</errors>
<id xsi:nil="true"/>
<success>false</success>
</result>
</upsertResponse>
</soapenv:Body>
Since we are using standard SOAP and Enterprise WSDL, we are not sure how to include Case Record Id in the response if there is a failure in Case updation. Please let us know if there is a way for this.
Thanks.