FieldSet Describer

Well Summer 12 is approaching with lots of new enhancements including fieldset describing feature from within apex.This was most awaited feature for me because have done a lot work around to achieve the same result.
Thanks to Abhinav Gupta from whose blog( I actually got Idea how to develop these feature. Sometime back Abhinav wrote about describing picklist based on recordtype, I took the code from there and made some changes in the classes and Eureka! a fieldset describer is at your service.

Well since Summer 12 is approaching very fast and after that this will not be of any use,So this for those user who are still stuck in Spring 12 and need a work round to get a List of field names that a field set contains. Well you can install the package from this link

It mainly contains two classes. A visulaforce controller to generate a page using the fieldset and parsing the response and another main class to which we send Field Set name and Object name.

How to describe a fieldset?
Its very easy just follow the below code.

List<String> fieldNameList = FieldSetDescriber.describeFieldSet('<Your Object Name>','<Your Field Set Name>');

No comments:

Post a Comment