function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason FungJason Fung 

How to build customized Visualforce page that shows certain fields, depending on I specify in a text file?

I am a newbie salesforce develoepr working for a ISV and we support multiple customers. The chanllenge I have right now is that some customers have certain custom fields while others don't have the fields. 

Does anyone here know how I can build a visualforce page so that the field name is not hard-coded in my visualforce page. Instead I want to be able to specify the field names that I want to display in a text file, so that the fields that are displayed in my visualforce page are adjustable for each customers. 

I am stuck on this for a while now. Any help is greatly appreciated!!!  
Best Answer chosen by Jason Fung
Gyanender SinghGyanender Singh
Hi Jeson,

According to your requirement suppose that you have two user and you want to show field according to their choice and you want change field using text file.

So if this is the issue so for this you can use two field sets and add the fields in these field set.
In the apex class show these field set according to the user criteria.
In future if you want to add or remove any fields so you will not do the chagnes in the code , you just add or remove field using the configuration.

Please let me know if you need any help for the same.

Regards,
Gyani

All Answers

Gyanender SinghGyanender Singh
Hi Jeson,

According to your requirement suppose that you have two user and you want to show field according to their choice and you want change field using text file.

So if this is the issue so for this you can use two field sets and add the fields in these field set.
In the apex class show these field set according to the user criteria.
In future if you want to add or remove any fields so you will not do the chagnes in the code , you just add or remove field using the configuration.

Please let me know if you need any help for the same.

Regards,
Gyani
This was selected as the best answer
Jason FungJason Fung
Thanks for your reply Gyanender. I will look into field set and from your explaintaion it looks like it will fufill my use case.