-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invoice_Email.ds
35 lines (34 loc) · 1.05 KB
/
Invoice_Email.ds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
salesorderID = salesorder.get("salesorder_id");
salesorderdate = salesorder.get("date").toDate();
organizationID = organization.get("organization_id");
dc = organization.get("data_center_extension");
resp = invokeurl
[
url :"https://inventory.zoho" + dc + "/api/v1/invoices/fromsalesorder?salesorder_id=" + salesorderID + "&organization_id=" + organizationID
type :POST
connection:"zom"
];
inv = resp.get("invoice");
invoiceID = inv.get("invoice_id");
contact_persons_details = inv.get("contact_persons_details");
ListEmails = List();
for each contact in contact_persons_details
{
if(contact.get("is_primary_contact") == true)
{
emailTo = contact.get("email");
ListEmails.add(emailTo);
}
}
jsonstring = Map();
jsonstring.put("to_mail_ids",ListEmails);
params = Map();
params.put("JSONString",jsonstring);
response = invokeurl
[
url :" https://inventory.zoho" + dc + "/api/v1/invoices/" + invoiceID + "/email?organization_id=" + organizationID
type :POST
parameters:params
connection:"zom"
];
info response.get("message");