function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LWDeveloperLWDeveloper 

XML For Creating/Updating New Records

Hello,

 

I am trying to plan out an integration with a third-party system and I need a sample XML for when a new record is created/updated in Salesforce (e.g. a new Account is created or a Contact record is updated). I know where to find the general XML schema but will need more than than just this. Is there a way to get a sample XML that I require?

 

Thanks for your help in advance.

Nandu123Nandu123

It would be great if you elaborate what you actually looking for.Below is Sample xml for contacts and account.

 

<Record>
<Id>01</Id>
<ext_data_attr__c>firstname</ext_data_attr__c>
<external_system__c>SamppleExtSystem</external_system__c>
<object_field__c>Name</object_field__c>
<object_name__c>Account</object_name__c>
</Record>



<Record>
<Id>01</Id>
<ParentId>01</ParentId>
<ext_data_attr__c>firstname</ext_data_attr__c>
<external_system__c>SamppleExtSystem</external_system__c>
<object_field__c>firstname</object_field__c>
<object_name__c>Contact</object_name__c>
</Record>

 

 

Leon MorockiLeon Morocki

Did you mean the sample SOAP request for creating/updating records in salesforce?

 

Here is an example of such:

 

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com"  xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>SESSION_ID</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create xmlns="urn:enterprise.soap.sforce.com">
        <sObjects xsi:type="FeedItem" xmlns="urn:sobject.enterprise.soap.sforce.com">
            <ParentId>FIELD1</ParentId>
            <Body>FIELD2</Body>
            <Type>FIELD3</Type>
        </sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope> 

 

LWDeveloperLWDeveloper

Thanks so much for your help so far. I'll try to be more specific. 

 

What I need is as follows- 

 

We want to integrate Salesforce.com with another third party system via webservice. Salesforce.com will be the books and records system, whenever there is an update made or any new account / contact is created, that has to be updated on the third party system To do this, we are thinking of making an API call from SalesForce.com.

 

When SalesForce.com make a API call, to update our third party system I just wanted to know the XML which will be passed from SF to said third party.

 

The three in particular will be Accounts, Contacts, and a custom object. 

Leon MorockiLeon Morocki

Is third-party WebService a SOAP or REST?

If SOAP, you should probably have it's WSDL. You can make Salesforce parse the WSDL and generate wrapper classes for you, so that you can call remote WebService methods transparenty, just as any local method.

LWDeveloperLWDeveloper

It'll be a SOAP. I'll try this out! Thanks!

Leon MorockiLeon Morocki

You can also import the WSDL into a WebService client, like SoapUI, and it will generate sample requests, so that you can see the exact XML that is going to be sent.

DeepakKapoor81DeepakKapoor81

Hi,

 

Can you please let me know from where I can create the xml of full record...

 

You help will be very appreciated..

 

Thanks

Deepak Kapoor

DeepakKapoor81DeepakKapoor81

May I know how can I get the XML of new created crecord in salesforce..