Required to Fill Comment Before Approved/Rejected Using Apex Code
Requirement: When User Approved or Rejected the approval then it is required to fill Approval or Rejected reason Solution : You need to write the the trigger on Before Update as mention below private void ApprovedOrRejectedComment(list<Sobject> triggerNew, map<id,Sobject> triggerOldMap) { Map<Id, Sobject> MapIDToObject = new Map<Id, Sobject>{}; for(Sobject objSobj: triggerNew) { Sobject oldobjSobj = triggerOldMap.get(objSobj.Id); if (((oldobjSobj.Status != 'Approved' && objSobj.Status == 'Approved' ) ||(oldobjSobj.Status != 'Rejected' && objSobj.Status == 'Rejected'))) { MapIDToObject.put(objSobj.Id, objSobj); } } if (!MapIDToObject.isEmpty()) { List<Id> processIn...