+ Start a Discussion
Arun KArun K 

dynamic search functionality for account object

could any one send the dynamic search functionality for account object..??

in any field..

Best Answer chosen by Admin (Salesforce Developers) 
JitendraJitendra

Hi,

You could write by yourself only.

 

you can write code something like below:

 

String fieldAPIName = 'Name';
String fieldValue = 'Val1';
 
String q = 'Select Id FROM Account WHERE '+fieldAPIName +" = "+fieldValue ;

List<sObject> acc = Database.query(q);

 

Read this documentation URL:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_soql.htm