+ Start a Discussion
SFDC coderSFDC coder 

SOAP request for delete call

hi all,
i have created a soap delete request in soap ui tool to delete records in salesforce using External id rather than using the SFDC record id however i am getting the below mentioned response 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <faultstring>Element {urn:enterprise.soap.sforce.com}sObjects invalid at this location</faultstring>

my delete soap request is 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">


        <!--Zero or more repetitions:-->

         <urn:sObjects urn:type="Product__c">





Any help would be appreciated

Did you put the valid sessions Id just like last time. There might be case of Session Id is expired so get a new one like you did yeasterday and try it. I am sure it will work.

PS: if this answers your question then hit Like and mark it as solution!
SFDC coderSFDC coder
yes its valid..
since i don't want to disclose it here i have put XXXXX.Also the other calls are working with the same session id
It is saying "sObjects invalid at this location" so is there any Product__c record exist with that external Id value?
SFDC coderSFDC coder
thanks for your kind assistance.
Yes it does exist i searched it globally and i found one record
You might find the record for that but is it having "456721" value in Product_Id__c field on that record. Set debug logs with the user you got that session Id and check what it shows. I am sure there is something weird around data.
SFDC coderSFDC coder
yes it is see the below screen

User-added image
Hmmm!! My best guess is, sometimes SFDC don't like SOUP UI/Manupulated SOAP request formats. But once you generate stub classes in Java using wsdlTojava or other tools, you should be able to make an easy callout as you will get parametric functions in those classes generated and you don't need to worry about these request formats.

PS: if this answers your question then hit Like and mark it as solution!
Hi Sumit

Could you please share a sample where we can use the external id of the Lookup object. Thanks.