Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CalculateShippingDate {
- @InvocableMethod(Label='add two business days')
- public static void addTwoBusinessDaysToCase(List<Case> inputCase){
- Datetime plusTwoDays = BusinessDays.addGmt(System.today(), 2);
- List<Case> caseList = [SELECT Id, Shipping_Date__c
- FROM Case
- WHERE Id = :new Map<Id, Case>(inputCase).keySet()];
- Case currentCase = caseList.get(0);
- currentCase.Shipping_Date__c = plusTwoDays.Date();
- update currentCase;
- System.debug('The case was updated with an shipping date date of: ' + currentCase.Shipping_Date__c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement