Friday 27 May 2011

How to Use Field Set in VF page

Problem :-  We have to show some fields on VF Page and can add/remove fields on page at run time without making any change in VF page code.
Solution :- So here we can go through step by step.
Step1):-
             follow by clicking in sandBox org. on User's Name>Setup>customize>Account(any standard Object)>field set.
Step2.):-
           Create New field Set According to requirement.
(One thing should keep in mind once you create Available list in field Set then after making package you can not change it)
Step3.):-
           Create your VF page(Here I am mentioning one Sample Code)

VF Page code:-



    
       
           
               
                             
       
        
                           
           
    
Screen Shot:-




Here I have included 4 fields of Account Sobject if I want to add/remove some fileds I can easily do this just by changing in field Set (not need to change in VF page).we can use field set for custom object also.




No comments:

Post a Comment