Through User Interface
To Know Standard Object API Names follow this below link,
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_list.htm
To Know Custom Object API Names
Go to Setup--> Build --> Create --> Object --> Click the Object Name --> then you will find the API Name.
Through ApexCode
If you want to retrieve object label and API Name via Apex coding means you can use the following code,
To Know Standard Object API Names follow this below link,
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_list.htm
To Know Custom Object API Names
Go to Setup--> Build --> Create --> Object --> Click the Object Name --> then you will find the API Name.
Through ApexCode
If you want to retrieve object label and API Name via Apex coding means you can use the following code,
01 | List <Schema.SObjectType > gd = Schema.getGlobalDescribe().Values(); |
02 |
03 | Map< String , String > objName = new Map< String , String > (); |
04 | for (Schema.SObjectType f : gd) |
05 | { |
06 | if (f.getDescribe().isCustom()) |
07 | { |
08 | objName.put(f.getDescribe().getLabel(),f.getDescribe().getName()); |
09 | } |
10 | } |
11 |
12 | System .debug( 'Object Names' +objName); |
Exactly I was looking for. Thanks King :)
ReplyDelete