You need to sign in to do that
Don't have an account?
Vincent Bartoloma
Scheduled auto Lead creation
I am attempting to distribute Leads from a list on a weekly basis. I have this code which is producing an error : "Global variable must be contained in a global class". I don't understand this since I have the class labeled as global.
Any ideas ?
global class WeeklyPreOppProcessor { { global void execute (SchedulableContext scx) { Group group = [Select Id, Name FROM Group WHERE Type = 'Queue' AND Name = 'Distributed_Queue']; List<Lead> lstLead = [SELECT Id, Name, OwnerId FROM Lead WHERE Distributed__c = false LIMIT 50]; for(Lead leadObj:lstLead) { leadObj.Distributed__c = true; leadObj.OwnerId = group.Id; } update lstLead; } }
Any ideas ?
You have extra open bracket "{" in line 2. Removing that will resolve the issue.
Thanks for your help !