• Aladin Banwal
  • NEWBIE
  • -1 Points
  • Member since 2018
  • Salesforce Developer
  • Confident Governance


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
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.
Created two field (data type-picklist) on the opportunity and have to make the fields mandatory when advancing a F S opportunity beyond Stage 2.  Make mandatory for the profile F S S R and F S S M only. 

for this scenario have to create a validation rule. Please help me out for this..
 
and if the scenario will be changed to 

According to the above scenario 2 fields (data type-picklist) should be mandatory based on the user profile (F S S R or F S S M).  Instead we would like the validation rule to be if the Sales Occupy (a picklist field on opportunity) = Field Sales, then the 2 fields are mandatory. 
 
please help me to write the validation rule for both the scenarios...

Thank you!!
  • February 08, 2019
  • Like
  • 0