Code for Version 2.0 API:RelatedQuotes = zoho.crm.getRelatedRecords("Quotes", "Deals", potId.toLong(),1,200);
//info RelatedQuotes;
total = 0.0;
for each ele in RelatedQuotes
{
grand =ifnull(ele.get("Grand_Total"),"0.0").toDecimal();
total = (total + grand);
}
mp = map();
mp.put("Amount", total);
update = zoho.crm.update("Deals", potId.toLong(), mp);
info mp;
info update;Code for Version 1.0 API:potIdStr = input.potId.toString();RelatedQuotes = zoho.crm.getRelatedRecords("Quotes", "Potentials", potIdStr);info RelatedQuotes;total = 0.0;for each ele in RelatedQuotes{grand =ifnull(ele.get("Grand Total"),"0.0").toDecimal();total = (total + grand);}mp = map();mp.put("Amount", total);update = zoho.crm.updateRecord("Potentials", potIdStr, mp);info mp;info update;
Code for Version 2.0 API:RelatedQuotes = zoho.crm.getRelatedRecords("Quotes", "Deals", potId.toLong(),1,200);
//info RelatedQuotes;
total = 0.0;
for each ele in RelatedQuotes
{
grand =ifnull(ele.get("Grand_Total"),"0.0").toDecimal();
total = (total + grand);
}
mp = map();
mp.put("Amount", total);
update = zoho.crm.update("Deals", potId.toLong(), mp);
info mp;
info update;Code for Version 1.0 API:potIdStr = input.potId.toString();RelatedQuotes = zoho.crm.getRelatedRecords("Quotes", "Potentials", potIdStr);info RelatedQuotes;total = 0.0;for each ele in RelatedQuotes{grand =ifnull(ele.get("Grand Total"),"0.0").toDecimal();total = (total + grand);}mp = map();mp.put("Amount", total);update = zoho.crm.updateRecord("Potentials", potIdStr, mp);info mp;info update;
Writer is a powerful online word processor, designed for collaborative work.