I am working on a Search Function using custom controller. I have 4 Filters (Account Name, Country, Account Type, Contact Name) in my Search Criteria Section.

I have a requirements that, it must have a facility where System Administrator can limit the number of filters displayed on the Search Criteria.

How will I do this?

I think there will be a scenario that the admin can choose either, which the four filter is to be displayed.


To achieve this

  • Have a custom setting to maintain which fields needs to be enabled as the filter criteria for your search.
  • In visual force page, display only those filters which are enabled in custom setting by system administrator.
  • In controller, write a dynamic SOQL to get the results based on the filter criteria.
  • I checked the custom setting and i have no idea on how to create a field or to enabled. Can you share me a link? So that i can refer on it. – Leorah Sumarong Feb 11 '19 at 13:17
  • Or Can you give me a sample? on how to create? Sorry i am just a newbie on this work. – Leorah Sumarong Feb 11 '19 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.