+ Start a Discussion
shra1_devshra1_dev 

How to get the Id of a field through Apex?

Hi,

 

 

Is it possible to get the Field Id like we get the Object KeyPrefix from SObjectDescribeResult?

 

 

Regards,

Shravan

Shashikant SharmaShashikant Sharma

There is nothing like field id but you can get field API Name and other information from describe call.

shra1_devshra1_dev

Hi Shashikant,

 

But everything that we create in Salesforce will be stored in objects like Apex Classes,, VF Pages, Objects, Fields etc..

 

Field Id can be seen when we visit detail page of a Field of an object. You can find the Id in the URL starting with 00N prefix.

 

So I want to get that Id, but I could find Id in FieldDescribeResults.

 

I need help in retrieving field Id through apex when I pass the Object and field API names.

 

 

Regards,

Shravan