You need to sign in to do that
Don't have an account?
PXForce
query
When I pass this query in the start ethod of batch process it works fine
Database.getQueryLocator([Select Id From Lead Where Isconverted = : false And Company =: 'ABC' ]);
Now if I want to pass it as a string like below then it doesnt work
Boolean f = false;
String query = 'Select Id,Name From Lead Where IsConverted =\'' + f + '\' And Company =\'' + 'ABC' + '\'';
I know i am making some mistake in formatting the string. Please guide me to some documentation that can help resolve this. (format queries as string)
boolean's shouldn't be quoted, you need to generate ... isConverted=false, but you're generating isConverted='false'
This should work
String query = 'Select Id,Name From Lead Where IsConverted ='+f+' And Company =\'ABC\'';
So how do you fix it?.
If i just say 'IsConverted = false' , it says it doesnt recognize false. Same with 'IsConverted = ' + f + '';