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
sauravsharma001sauravsharma001 

How to get the metadata of fields including the custom fields of case in apex class?

How to get the metadata of fields including  the custom fields of case in apex class?

Like the default value , description, required or not , type, etc .

Subhani PSubhani P

Hi Sourav,

 

Please refer the following links also.

 

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_types_list.htm

 

 

Thanks,
Subhani,
Salesforce Certified Developer,
www.mydbsync.com

sauravsharma001sauravsharma001

@Subhani Can you tell me how to use the Metadata types , as I am new to Salesforce. Does I have to download the metadata WSDL  from salesforce account and create a apex class using the metadata wsdl ?

Satish_SFDCSatish_SFDC
All this information is available through the Metadata API. You will have to download the Metadata WSDL and the partner WSDL (to connect to salesforce) and then retrieve the fields.

You can also use the Force.com Migration tool to get all the details.
This tool uses the Metadata API behind the scenes and will fetch the metadata required by you.

Force.com Tool Link:
http://wiki.developerforce.com/page/Migration_Tool_Guide

Regards,
Satish Kumar
sauravsharma001sauravsharma001

@Satish Thanks for your help. I will try this .

Satish_SFDCSatish_SFDC
Are you using the Force.com Migration tool or the Metadata api.

Force.com Migration tool is ANT based and uses the same metadata api.
Let us know if you face any problems. The usage is simple and does not require you to write any code.

Also one other tool is the Force.com IDE, a plugin over eclipse. Force.com Migration Tool is a command line based tool. The IDE is a graphical tool and will also let you get the information about the fields etc.

Regards,
Satish Kumar
sauravsharma001sauravsharma001

@Satiish I am going to use metadata API . I only want the details of the custom field of the Case Object.  And I don't think Migration is going to help me.

Satish_SFDCSatish_SFDC
Ok.
So all the options work for you: IDE, Metadata API or the Force.com Migration tool.
Use any tool which suits you.


Regards,
Satish Kumar