1

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.

0

The result list is in the same order as the original. Just check by array index. Note that since this is an upsert, there may or may not be an ID anyways. If you need to retrieve the record by external ID (e.g. to get the case ID), you would need a separate API call if you don't already have the Salesforce ID. The REST API provides a mechanism for this:

/services/data/v45.0/sobjects/Case/External_Id_Field__c/500000000123456AAA
  • Thanks @sfdcfox for the response. SAP is the external system in our case which upserts case records and receives response from Salesforce and they have no access to the payload once submitted to Salesforce for the purpose of including it in the response. So, please let me know if there is any alternative to include the Case Id in the response? – Suha Feb 25 at 6:39
  • Cant you go for custom service in such case? – Jaya Feb 25 at 6:42
  • This integration exists for many months and we want to explore if there is a possibility to include Case Id in the response with standard SOAP API before proposing custom service. – Suha Feb 25 at 7:18
  • 1
    @Suha Yeah, you'd need a custom service then. The API expects you to know what you submitted to begin with. – sfdcfox Feb 25 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.