Skip to content

Instantly share code, notes, and snippets.

@jeznag
Created February 4, 2018 02:38
Show Gist options
  • Save jeznag/ce200a11f0a3fe3fa316c9d88bbbf30b to your computer and use it in GitHub Desktop.
Save jeznag/ce200a11f0a3fe3fa316c9d88bbbf30b to your computer and use it in GitHub Desktop.
adding purchase orders
products_for_purchase_order = List:Map();
products_for_purchase_order.add({
"Product Id": product_for_purchase_order.get("PRODUCTID"),
"Quantity": item_data.get("quantity"),
"Product Name": product_for_purchase_order.get("Product Name"),
"Unit Price": product_for_purchase_order.get("Unit Price")
});
new_purchase_order = {
"Subject": "TESTING!@#!#",
"ACCOUNTID": sales_order_record.get("ACCOUNTID"),
"PO Number": sales_order_record.get("Contract Number"),
"Tracking Number": sales_order_record.get("Contract Number"),
"Sales Order_Id": sales_order_record.get("SALESORDERID"),
"PO Date": zoho.currentdate,
"Opportunity Information_ID": sales_order_record.get("POTENTIALID"),
"Billing Street": sales_order_record.get("Billing Street"),
"Billing City": sales_order_record.get("Billing City"),
"Billing State": sales_order_record.get("Billing State"),
"Billing Code": sales_order_record.get("Billing Code"),
"Billing Country": sales_order_record.get("Billing Country"),
"Shipping Street": sales_order_record.get("Shipping Street"),
"Shipping City": sales_order_record.get("Shipping City"),
"Shipping State": sales_order_record.get("Shipping State"),
"Shipping Code": sales_order_record.get("Shipping Code"),
"Shipping Country": sales_order_record.get("Shipping Country"),
"Product Details": products_for_purchase_order
};
create_resp = zoho.crm.create("PurchaseOrders", new_purchase_order);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment