Invoice Owner |
Invoice Number |
Created By |
Due Date |
<<Invoices.Invoice Owner>> |
<<Invoices.Invoice Number>> |
<< Invoices. Created By>> |
<<Invoices.Due Date>> |
Product_Code |
Product_Description |
Item_Quantity |
Item_Price |
«Products.Product_Code» |
«Products.Product_Description» |
«Products.Item_Quantity» |
«Products.Item_Price» |
{
"merge": [
{
"id": "First_Name",
"groupname": "Contacts",
"display_name": "First Name",
"type": "text"
},
{
"id": "Email",
"groupname": "Contacts",
"display_name": "Email",
"type": "email"
},
{
"id": "Invoices",
"display_name": "Invoices",
"type": "subform",
"fields": [
{
"id": "Invoices.Owner",
"groupname": "Invoices",
"display_name": "Invoice Owner",
"type": "text"
},
{
"id": "Invoices.Invoice_Number",
"groupname": "Invoices",
"display_name": "Invoice Number",
"type": "number"
},
{
"id": "Invoices.Created_By",
"groupname": "Invoices",
"display_name": "Created By",
"type": "text"
},
{
"id": "Invoices.Due_Date",
"groupname": "Invoices",
"display_name": "Due Date",
"type": "text"
}
]
},
{
"id": "Products",
"display_name": "Products",
"type": "subform",
"fields": [
{
"id": "Products.Product_Code",
"groupname": "Products",
"display_name": "Product Code",
"type": "text"
},
{
"id": "Products.Product_Description",
"groupname": "Products",
"display_name": "Product Description",
"type": "text"
},
{
"id": "Products.Item_Quantity",
"groupname": "Products",
"display_name": "Item Quantity",
"type": "number"
},
{
"id": "Products.Item_Price",
"groupname": "Products",
"display_name": "Item Price",
"type": "number"
}
]
}
],
"sign": {},
"fill": {}
}
invoicesRecords = zoho.crm.getRecordById("Invoices", invoiceId);
CustomerInvoice = Map();
CustomerInvoice.put("First_Name", invoicesRecords.get("Account_Name").get("name"));
CustomerInvoice.put("Email", invoicesRecords.get("Account_Name").get("id"));
invoicesList = list();
invoiceDetails = Map();
invoiceDetails.put("Invoices.Owner", invoicesRecords.get("Owner").get("name"));
invoiceDetails.put("Invoices.Invoice_Number", invoicesRecords.get("Invoice_Number"));
invoiceDetails.put("Invoices.Created_By", invoicesRecords.get("Created_By").get("name"));
invoiceDetails.put("Invoices.Due_Date", invoicesRecords.get("Due_Date"));
invoicesList.add(invoiceDetails);
productList = list();
productDetails = Map();
productDetails.put("Products.Product_Code", invoicesRecords.get("Product_Code"));
productDetails.put("Products.Product_Description", invoicesRecords.get("Product_Description"));
productDetails.put("Products.Item_Quantity", invoicesRecords.get("Item_Quantity"));
productDetails.put("Products.Item_Price", invoicesRecords.get("Item_Price"));
productList.add(productDetails);
CustomerInvoice.put("Invoices", invoicesList);
CustomerInvoice.put("Products", productList)
mergedata = Map();
mergedata.put("merge_data", {"data": CustomerInvoice});
mergedata.put("subject", "Invoice Details");
//optional
mergedata.put("message", "Please find your invoice attached.");
info mergedata;
zoho.writer.mergeAndSend("eb4kob4cf65bb6d074af7a7de21e561119eb9", "pdf", invoicesRecords.get("email"), mergedata, "writer_name");
{
"data": [
{
"First_Name": "Amelia",
"Email": "amelia@zylker.com",
"Invoices": [
{
"Invoices.Owner": "John",
"Invoices.Invoice_Number": 1279,
"Invoices.Created_By": "Amelia",
"Invoices.Due_Date": "07/10/2020"
}
]
"Products": [
{
"Products.Product_Code": "A123",
"Products.Product_Description": "Mobile Cases",
"Products.Item_Quantity": 2,
"Products.Item_Price": 1000
}
]
}
]
}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.