/** * @description stamps First Response Date/Time field when * case updates from Open to Pending status */ public void updateFirstResponse() { for (Case newCase : newCaseMap.values()) { final Case oldCase = oldCaseMap.get(newCase.Id); if ((OPEN_STATUS.equalsIgnoreCase(oldCase.Status) || NEW_STATUS.equalsIgnoreCase(oldCase.Status)) && PENDING_STATUS.equalsIgnoreCase(newCase.Status)) { newCase.First_Response_Date_Time__c = DateTime.now(); } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter