Skip to content

Instantly share code, notes, and snippets.

@jeznag
Created November 25, 2017 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeznag/536c64ac94f762f8057633113b0a79ae to your computer and use it in GitHub Desktop.
Save jeznag/536c64ac94f762f8057633113b0a79ae to your computer and use it in GitHub Desktop.
custom related list in Zoho CRM
string getProductsFromPurchaseorder(string purchase_order_id)
{
purchase_order_record = zoho.crm.getRecordById("PurchaseOrders",input.purchase_order_id.toLong());
line_items = purchase_order_record.get("product").toJSONList();
xml_for_related_list = "<record>";
idx = 0;
for each line_item in line_items
{
line_item_map=line_item.toMap();
xml_for_related_list=((xml_for_related_list + ("<row no='" + idx + "'><FL val='product name'>" + line_item_map.get("Product Name")) + "</FL><FL val='quantity'>") + line_item_map.get("Quantity")) + "</FL></row>";
idx=(idx + 1);
}
return xml_for_related_list + "</record>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment