What is FieldSet ?
It is nothing but grouping the related fields in the sObject & giving them a Name.
What is the use of it ?
Since, it's a group of fields it can be used as a collection, rather than individual fields. At beginning, it may seems not required, but as organization grows, this feature is very important to maintain the Org health.
Where should be used ?
This will be used mainly in Visualforce & Apex. For example, you have created a feature which requires 100 fields to be processed by the user. Would you be happy to add inputField/outputField in the Visualforce page for all 100 fields ? Won't you think is there any better way ?yes, fieldset is the solution. you just fieldset to iterate through the fields & use them. These are the usefulness,
- efficient coding
- less maintainance
- future proof - you can add a field or remove from the fieldset, but doesn't need to change the page.
Thanks a lot for clearing concept.
ReplyDelete