• Mohamed Azarudeen 21
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Orginal Query

Select name,Salary from Account where (name ='Smith' and Salary > 10000)

My Visulaforce page

No   Fields   Clause        Value

1)   name     equals             Smith
2)   Salary   Greater than    10000  
 

Dynamic Query looks like

Select name, Salary from Account where (Fields Clause Value)

Can you please help me for this Apex class logic?
 
Orginal Query

Select name,Salary from Account where (name ='Smith' and Salary > 10000)

My Visulaforce page

No   Fields   Clause        Value

1)   name     equals             Smith
2)   Salary   Greater than    10000  
 

Dynamic Query looks like

Select name, Salary from Account where (Fields Clause Value)

Can you please help me for this Apex class logic?
 

I need to perform a SOQL query in Apex with dynamic parameters. The object names and field names are dynamic. A query something like
select :fieldName1, :fieldName2 from :objectName

The fieldName1, fieldName2 and objectName will be known only at runtime.

Is there any way to perform such a query in Salesforce?

Many Thanks,

Naveen