You need to sign in to do that
Don't have an account?
SunnyShiny
Variable does not exist
hello
I try to run a batch throught the developer console but Ive got variable val does not exist>
String val = 'Sales';
String soqlQuery = 'Select id from Contact Where RecordType.Name =:val limit 1';
system.debug(soqlQuery);
Id batchInstanceId = Database.executeBatch(new BATCH_UpdateObject('Select id from Contact Where RecordType.Name in:val limit 1','Contact','',''), 10);
Thanks for your help
try this.
Hello SunnyShiny,
The problem is in yor last line where you are calling the batch class.
While passing you are passing the String Query which has Local variable but does not exist in batch class.
So instead of passing it as a query with variable, use query as NaiduPothini has suggested.
Try something like this and let us know if it you still face any issues.