+ 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();