Work_Order_Id = work_order.get("id"); Service_Line_Items = work_order.get("Service_Line_Items"); line_item_id_list = list(); for each Service_Line_Item in Service_Line_Items { line_item_id = Service_Line_Item.toMap().get("id"); line_item_id_list.add(line_item_id); } data = {"data":{{"Work_Order":Work_Order_Id,"$Service_Line_Items":line_item_id_list,"$finance_data":{"discount_preference":{"Adjustment":0}}}}}; invoice_response = invokeurl [ type :POST parameters:data.toString() connection:"fsmcon" ]; info "invoice_response: " + invoice_response; invoice_id = invoice_response.get("data").toMap().get("Invoices").toMap().get("id"); contact_id = work_order.get("Contact").toMap().get("id"); contactResp = zoho.fsm.getRecordById("Contacts",contact_id); contactData = contactResp.get("data").toMap(); email = contactData.get("Email"); email_list = list(); email_list.add(email); invoice_data = {"data":{"send_invoice_pdf":true,"to_mail_ids":email_list,"send_from_org_email_id":true}}; send_invoice_response = invokeurl [ url :"https://fsm.zoho.com/fsm/v1/Invoices/" + invoice_id + "/actions/send_invoice" type :POST parameters:invoice_data.toString() connection:"fsmcon" ]; info send_invoice_response; |
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.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.