First Response Method

PHOTO EMBED

Wed Apr 06 2022 06:38:21 GMT+0000 (Coordinated Universal Time)

Saved by @willamaglaya

    /**
     * @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();
            }
        }
    }
content_copyCOPY

https://seek--prototype2.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage