+ Start a Discussion
Nitin SehgalNitin Sehgal 

How to create dynamic SOQL for searching results

Hi Everyone,

 

I want to create a Dynamic SOQL using Field set. What i have is, i have two fieldsets Search_Criteria and Search_Results.

First fieldset is for searching purpose and other one is associated with a PageBlockTable to display result.

I am confused how to create a SOQL command which can filter the result using fieldset values.

 

Thanks in advance,

Nitin

Avidev9Avidev9
I wrote few blogs over fieldset, I guess they will be helpful

Generate Query From Fieldsets : http://blogforce9.blogspot.in/2012/10/generate-query-from-fieldsets.html

Working with Fieldsets : http://blogforce9.blogspot.in/2013/03/working-with-fieldsets.html
Vishnu Bijjula 4Vishnu Bijjula 4
Thanks Avidev9,
Your link really helpful to understand indept of FieldsSets but I need to control the FieldSets in WHERE clause. For instance in Account Fieldset having name and type, I need to control this on WHERE clause in SOQL like SELECT id from ACCOUNT where name=(Account Fieldset Name Value) and type=(Account Fieldset Type Value).
Thank you in Advance!