You need to sign in to do that
Don't have an account?
Aladin Banwal
I've scheduled this batch class for daily.
Can we write Batch Apex to update custom picklist field in User object?
global class memberBirthdayBatch implements Database.Batchable<sObject>{ global Database.querylocator start(Database.BatchableContext BC){ return Database.getQueryLocator([select id, water_demo__Birthday__c from User]); } global void execute(Database.BatchableContext BC, List<User> us){ for(User u : us){ u.water_demo__Birthday1__c= 'Today'; } try { update us; } catch(Exception e) { System.debug(e); } } global void finish(Database.BatchableContext BC){ } }Actually, I've used this same code for Account object and it's working fine but when I change it for User it is not working
I've scheduled this batch class for daily.
Raj Vakati
Code looks clean to me .. can you check the debug logs why its failing >>>