You need to sign in to do that
Don't have an account?
Need to know a better way to accomplish this instead of????
I have 4 filters 2 inputtext boxes and 2 picklists on a VF Page and a button.
Now my report works when u pick or type in anyof the forms on the VF and then click Go...
My question is how do I write conditions if they pick 2 or more values from the VF page in apex to re-query..
I am using Dynamic SOQL and requery function...
This works for one filter... How do I make it for 2 or more filters????
if(course!='Select a Course'){
qryString = qryString + 'where ' + CourseName + '=' + '\''+ course+'\'';
}
if(teachername!=null){
qryString = qryString + 'where ' + teacher + '=' + '\''+ teachername+'\'';
}
if(studentname!=null){
qryString = qryString + 'where ' + student + '=' + '\''+ studentname+'\'';
}
If all three of your queries are same, you can write like this,
if(course!='Select a Course' && teachername!=null && studentname!=null)
{
qryString = qryString + 'where ' + CourseName + '=' + '\''+ course+'\'' And ' + teacher + '=' + '\''+ teachername+'\'' And ' + student + '=' + '\''+ studentname+'\'';
}