Send Service Report To Customer

Send Service Report To Customer

Usecase: Email the service report to the customer on service appointment completion.
 
Follow the steps below to implement this usecase:

Step 1: Create a connection for Zoho FSM

To use the FSM APIs via the invokeURL task in the custom function, you need to create a connection for FSM. To do so:
  1. Navigate to Setup > Developer Space > Connections and click Create Service.



  2. Enter the following details and click Create Service.
    1. Service Name: FSMCon
      The Service Link Name will be automatically populated.
    2. Authentication Type: OAuth2
    3. Parameter Type: Header
    4. Grant Type: Authorization Code
    5. Generated Client ID, Client Secret
    6. Authorize URL: https://accounts.zoho.com/oauth/v2/auth?access_type=offline&prompt=consent
    7. Access Token URL: https://accounts.zoho.com/oauth/v2/token
    8. Refresh Token URL: https://accounts.zoho.com/oauth/v2/token
    9. Scope: ZohoFSM.modules.all, ZohoFSM.settings.modules.all
      Provide a Scope Display Name.



  3. Click Create Connection.



  4. Perform the following and click Create And Connect:
    1. Connection Name: FSMCon
      The Connection Link Name will be populated automatically.
    2. Select the Scopes ZohoFSM.modules.all, ZohoFSM.settings.modules.all



  5. Click Connect in the authentication page.



  6. Click Accept in the Authorization page.

In the custom function, where the FSM API is used via the invokeURL task, use this Connection Link Name.
 

Step 2: Create a custom function  

Create a custom function in Zoho FSM to email the service report to the customer on service appointment completion.
  1. Navigate to Setup > Automation > Functions and click Create Function.
  2. Enter the following details and click Save:
    1. Function Name: SendServiceReport
    2. Module: Service Appointments
    3. In the Deluge Editor, enter the following script:

      contactId = service_appointment.get("Contact").get("id");
      contactResp = zoho.fsm.getRecordById("Contacts",contactId);
      email = contactResp.get("data").toMap().get("Email");
      service_list = service_appointment.get("Appointments_X_Services").toList();
      for each  services in service_list
      {
       aptId = services.get("Service_Appointment").toMap().get("id");
       get_record = zoho.fsm.getRecordById("Service_Appointments",aptId);
       srResp = zoho.fsm.getRelatedRecords("Service_Reports","Service_Appointments",aptId);
       if(srResp != null && srResp.containKey("data"))
       {
        apRelatedrecords = srResp.get("data").get(0);
        reportpdfResp = apRelatedrecords.get("Service_Report_PDF");
        if(reportpdfResp != null)
        {
         fileurl = reportpdfResp.get(0).get("download_Url");
         fileResp = invokeurl
         [
          url :"https://" + fileurl
          type :GET
          connection:"fsmcon"
         ];
         sendmail
         [
          from :zoho.adminuserid
          to :email
          subject :"Zoho FSM Service Report"
          message :"PFA the service report pdf."
          Attachments :file:fileResp
         ]
        }
       }
      }

Step 3: Create a workflow rule  

Create a workflow rule in Zoho FSM to automatically email the service report to the customer on service appointment completion.
  1. Go to Setup > Automation > Workflow Rules and click Create Workflow.
  2. Enter the following details, then click Next:
    1. Module: Service Appointments
    2. Rule Name: Send Service Report
    3. Description: Email the service report to the customer on service appointment completion.



  3. Select the rule trigger as Edited and click Next.



  4. Select the rule criteria as Only to the Service Appointment matching certain conditions and add the condition Status is Completed. Click Next.



  5. Click +Action and select Function.



  6. Select Existing Functions and click Next.



  7. Select the custom function created in the previous step.



  8. Click Save.

Testing the usecase  

  1. Create a Service Appointment.
  2. Create a Service Report.
  3. Click Complete Work for the service appointment.

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION





                        Still can't find what you're looking for?

                        Write to us:  support@zohoforms.com


                              




                            

                              Zoho Marketing Automation

                                Zoho Sheet Resources

                                 




                                    Zoho Forms Resources


                                      Secure your business
                                      communication with Zoho Mail


                                      Mail on the move with
                                      Zoho Mail mobile application

                                        Stay on top of your schedule
                                        at all times


                                        Carry your calendar with you
                                        Anytime, anywhere




                                              Zoho Sign Resources

                                                Sign, Paperless!

                                                Sign and send business documents on the go!

                                                Get Started Now


                                                    Zoho SalesIQ Resources



                                                        Zoho TeamInbox Resources



                                                                Zoho DataPrep Resources



                                                                  Zoho DataPrep Demo

                                                                  Get a personalized demo or POC

                                                                  REGISTER NOW


                                                                    Design. Discuss. Deliver.

                                                                    Create visually engaging stories with Zoho Show.

                                                                    Get Started Now











                                                                                          • Related Articles

                                                                                          • Service Reports

                                                                                            A service report can be created for an appointment. It will capture the details of the service appointment, the associated contact details, and other inputs of customer acknowledgement such as signature, and rating. - Permission Required: Service ...
                                                                                          • Service Tasks

                                                                                            Service tasks are subtasks or child tasks that you can add to a service. When you want to handle a service that is a composite task consisting of several activities, then creating service tasks for the service will come in handy. For example, ...
                                                                                          • Send notifications of new requests

                                                                                            Use case: Notify the Administrator via SMS and the Call Center Agent via email of new requests. Here, the SMS will be sent via Twilio. Follow the steps below to implement this use case: Step 1: Create a connection for Twilio Step 2: Create a custom ...
                                                                                          • Manage Service Appointments

                                                                                            Scheduling Service Appointments All the service appointments in the Dispatch Console are initially scheduled by assigning them to a field technician or crew. Appointments can be scheduled from the Work Order Details page, as mentioned here. This can ...
                                                                                          • Configure Field Service Process

                                                                                            Schedule Status You can configure the name, and colour associated with the status of a work order, service appointment, estimates, or a request. The settings configured here will reflect in the service appointment bars in the Gantt view of the ...
                                                                                          Wherever you are is as good as
                                                                                          your workplace

                                                                                            Resources

                                                                                            Videos

                                                                                            Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                            eBooks

                                                                                            Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                            Webinars

                                                                                            Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                            CRM Tips

                                                                                            Make the most of Zoho CRM with these useful tips.



                                                                                              Zoho Show Resources