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
Vishnu7700Vishnu7700 

How to get object and feild API names in org

Hi,

Is there any way to get list of all object and feild API names in org.

 

Ideas are appricated.....

gbu.varungbu.varun

Hi Vishnu ,

 

It can be done by describeSObjects method in apex code

Vishnu7700Vishnu7700

Hi Varun,

Can you please provide code sample

gbu.varungbu.varun

Hi Just put the  following line in debug Log:

 

Map<String, Schema.SObjectType> gd =  Schema.getGlobalDescribe();
System.debug(gd);

 

It will return all the Object

Yoganand GadekarYoganand Gadekar

Hi vishnu,

Use the Schema getGlobalDescribe method to return a map that represents the relationship between all sObject names (keys) to sObject tokens (values). For example:
==> Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();