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

How to obtain the Field ID using apex?

Hi all, 


I know that it is possible to pre-populate fields by adding some parameters to the URL.


What I need is to retreive the Field ID to be able to pre-populate any field I want knowing the Object name and the field name.


Is it possible?




Thank you in advance.

Best Answer chosen by Admin (Salesforce Developers) 



There is no way to get the field id through apex. For prepopulating the fields u can create custom settings with the field id values and then u can use that in apex.