+ Start a Discussion
Meetesh JainMeetesh Jain 

18 Digit ID to Data

Hi All,
We are trying to integrate SFDC with our system and while trying to fetch an information from a field in SFDC through API , the values are getting fetched in 18 digits instead of hte actual name.

The filed which we are trying is called as Projects which should have names like RBC , Royal Bank of Scotland etc but it shows  like this 006w000000XweAaAAJ ( 18 digits)  in my application instead of the actual data.
How do we get this sorted.
Kindly help.
Arthur LockremArthur Lockrem
The id referenced is an opportunity Id (starts with 006).  If you can provide some of the code I'll be happy to provide a more exact explanation.  For now, hopefully this helps.  It would also be helpful to know which API you're using (REST, SOAP).

If you reference Opportunity.Id you'll get an 18 character id (like you provided).  If you reference Opportunity.Name you'll get RBC, Royal Bank of Scotland, etc.
Phillip SouthernPhillip Southern
Meetesh, when quering through SOQL you can actually traverse through the relationship to retrieve fields.  For example if the relationship field on your object is Projects__c and that is returning you an ID, you can do Projects__r.Name to retrieve the name of the project record.
Meetesh JainMeetesh Jain
Hi Arthur & Phillip,

Thank you for you assistance.
We are using SOAP.

Arthur LockremArthur Lockrem
Your WSDL will provide the exact mappings of fields and relationships.  I will make some assumptions based on default functionality.

If you are querying the Projects object (assumption: Project__c) and you are trying to reference the opportunity field (assumption: Project__r.Opportunity__c), you will get the 18 character id mentioned above.  If you reference the name of the opportunity record (assumption: Project__r.Opportunity__r.Name) you will get the name of each opportunity record.

Important: Notice the __r instead of __c in the relationships.
Deepak Kumar ShyoranDeepak Kumar Shyoran
You can get this Id easily by querying for the Opportunity field on the particular field which seems project in your case by using API name of Fields and Object.