How to include Approval/Denial reasons in the Service Request notifications or forms

Version 1

    Details

    When an Approver approves or denies a Service Request, they can enter a Reason for their decision. In order to be able to include this information in a notification (for example to the customer, or to the next level approver), or to have the reason appear on the Service Request form, additional configuration is required.


    Resolution

     

    This is advanced configuration, for more information on the specific steps to add fields, create quick actions, or create workflows, please refer to the Online Help.

    1.  On the FRS_Approval business object, create a new text field named ‘Reason’ (unlimited length).
     
    2.  On the Service Request business object, also create a new text field named ‘Reason’ (unlimited length).
     
    3.  On the FRS_Approval business object, add a new Update Quick Action. The Update should set the new Reason field to:
    $(ForEachChild("FRS_Approval#",
                   RecId,
                   "FRS_ApprovalVoteTracking#.",
                  "'Approval ' + Status + ' by '+OwnerFullName+' on '+ToString(ToClientTime(VotedDateTime))+'\r\nApproval Comment: '+ Reason + '\r\n_________________________\r\n'",
                   "CreatedDateTime DESC"))
     
    4.  On the Service Request business object, add a new Update Quick Action. The Update should set the new Reason field to:
    $(ForEachChild("ServiceReq#",
                                    RecId,
                                     "FRS_Approval#.",
                                      "Reason + '\r\n_______________________________\r\n\r\n'",
                          "CreatedDateTime DESC"))
     
    5.  On the FRS_ApprovalVoteTracking business object add a new Workflow, named 'Reason to Approval'.

    6.  Click the Configuration button and set the workflow to be triggered on creation or update of the record, where the Reason field is not empty. 

    7.  Create a new Run for Child block - set the relationship to FRS_ApprovalContainsFRS_ApprovalVoteTracking, select the Update quick action from Step 3. Set the field to RecID is not empty. 

    8.  Place the Run for Child block between Start and Stop blocks, connect them and save and publish the workflow.
     

    9.  On the FRS_Approval business object, add a new Workflow named 'Reason to Service Request'.

    10. Click the Configuration button and set the workflow to be triggered on creation or update of the record, where the Reason field is not empty.

    11. Create a new Run for Child block - set the relationship to ServiceReqAssociatedFRS_Approval, select the Update quick action from Step 4. Set the field to RecID is not empty. 

    12. Place the Run for Child block between Start and Stop blocks, connect them, and save and publish the workflow.
     
    13.  Add a field to the Service Request form as desired to display the Reason field, or you can add the Reason field on ServiceReq to notifications (You may need to add Wait blocks into the Service Request workflow between the Approval and the notification if adding it to notifications in that workflow in order for the data to catch up).