You need to sign in to do that
Don't have an account?

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 .
You will get all this information from Schema. Check the following pages.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_schema.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_Schema_DescribeFieldResult_instance_methods.htm
Check this
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_describesobjects_describesobjectresult.htm
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
@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 ?
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
@Satish Thanks for your help. I will try this .
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
@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.
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