+ Start a Discussion
Tithi NandyTithi Nandy 

ID field in Salesforce Objects

While looking into an existing code where a query used as "SELECT  Opportunity.Id, Opportunity.Name  From Opportunity where Opportunity.AccountID ="XXXX". As per my understanding, neither Opportunity nor any Object in Salesforce has the field "ID".Yet the field is used in querying in SF and result is also succesfully returned.Can anyone help where this "ID" field is coming from
PRABHAKARAN CHOCKALINGAMPRABHAKARAN CHOCKALINGAM
ID fields are automatically created by Salesforce to uniquley identify the records for every Objects in salesforce. As it doesn't have any value for the user to view these IDs (Its used in code and it doesn't give much info to display it), this is always hidden when accessing the records. 
For Instance, if you access a account record and look at the address bar, you will see the ID field in the browser in the end,
https://na31.salesforce.com/00137000003GWLa

This is like RowId in oracle.

Below page can give you more info,
https://help.salesforce.com/articleView?id=000004383&type=1
Tithi NandyTithi Nandy
Ohh..Okay.Sir Thanks a lot. Does this ID field is somehow related with Complex type "sObject" of Partner WSDL and element name="Id"? 
PRABHAKARAN CHOCKALINGAMPRABHAKARAN CHOCKALINGAM
Yes it is. Please refer some after Trigger code which clarifies the usage of IDs.
Tithi NandyTithi Nandy
Thanks Sir.I have one more query.The Enterprise WSDL consists of all objects available in Salesforce.But in my Organization's existing Enterprise wsdl,I found that Some additional objects (Complextype) are also present .Those are specific to my organizantion.Is it possible to add addional compextype depending one Organizantion's need.Please let me know,

If yes.how the connectivity is extablished.I mean in the enterprise WSDL ,if I find Complex type "Opportunity"/"Contact"/"Account", thosr are Salesforce's inbuild objects.keeping them in WSDL means I am accessing them through my Webservice call,but if some new additional org's specific Objects are present then how I am using them.Can there be some additional files which I am missing to look at.Please help.
PRABHAKARAN CHOCKALINGAMPRABHAKARAN CHOCKALINGAM
You can generate the Enterprise WSDL which will include all the Object including the custom objects you have created.
I am sure you would have come across this page, but here is a link.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_steps_generate_wsdl.htm

Also there are videos in PluralSight by RIchard Serotor, who explains the integrations using SOAP & REST APIs with salesforce.