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
Board salesforceBoard salesforce 

query and binding fieldset fields in query for search functionality?

Hi all,
As we do serch with getter setter to filiter the records on name etc.
I am trying using fieldsets , instead of changing the code always  i try to add field in the fieldset so i can have search for added field the problem is how to compare name using fieldsets in the query?
can any one help me
Thanks ,
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Board,
  • Currently, if you want to create an SOQL query, but have it be configurable and dynamically populated via a fieldset, you have to use dynamic SOQL, and loop through, creating a comma separated list of fields to query for.  Instead, developers should be able to use regular SOQL and variable binding, but also with fieldsets.
  • Please refer the below link for reference.
​I hope it will be helpful.

Best Regards
Rahul Kumar