You need to sign in to do that
Don't have an account?
![Jitendra Jangid Jitendra Jangid](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
way to get field description using partner API call
I'm using Partner API call to fetch various properties of field like field label, api name, data type. Along with these, I also would need to fetch field description but didn't find any method to fetching this particulr info.
Java code snip:
DescribeGlobalResult describeGlobalResult=partnerConnection.describeGlobal();
DescribeGlobalSObjectResult[] sObjResults=describeGlobalResult.getSobjects();
Field[] fObjArray=sObjResult.getFields();
for(Field fObj:fObjArray){
System.out.println(fObj.getLabel()+ " "+fObj.getName());
}
Thanks in advance!
Java code snip:
DescribeGlobalResult describeGlobalResult=partnerConnection.describeGlobal();
DescribeGlobalSObjectResult[] sObjResults=describeGlobalResult.getSobjects();
Field[] fObjArray=sObjResult.getFields();
for(Field fObj:fObjArray){
System.out.println(fObj.getLabel()+ " "+fObj.getName());
}
Thanks in advance!
You cannot get the Description using Describe calls in APEX.
A trick (and a very difficult one) is to use the Metadata API. You can do this via APEX - but the process is async. Since you want to fetch the information, it would require "retrieve" calls - and those are seriously difficult to do in APEX.
For more information please refer the below links:
http://andyinthecloud.com/2013/10/27/introduction-to-calling-the-metadata-api-from-apex/
http://www.salesforce.com/us/developer/docs/api_meta/api_meta.pdf
http://blog.jeffdouglas.com/2011/10/20/getting-salesforce-field-metadata-the-easy-way/
Please mark this as the best answer if it helps you.
Best Regards,
Nagendra.P
All Answers
You cannot get the Description using Describe calls in APEX.
A trick (and a very difficult one) is to use the Metadata API. You can do this via APEX - but the process is async. Since you want to fetch the information, it would require "retrieve" calls - and those are seriously difficult to do in APEX.
For more information please refer the below links:
http://andyinthecloud.com/2013/10/27/introduction-to-calling-the-metadata-api-from-apex/
http://www.salesforce.com/us/developer/docs/api_meta/api_meta.pdf
http://blog.jeffdouglas.com/2011/10/20/getting-salesforce-field-metadata-the-easy-way/
Please mark this as the best answer if it helps you.
Best Regards,
Nagendra.P