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 ] } } } |
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
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.
Write to us: support@zohoforms.com