Sum Related Records into Parent Record
Hello,
I have the below code and am trying to sum the Net Profit into the parent record, however i get this error...
Info
- {"code":"INVALID_DATA","details":{},"message":"the relation name given seems to be invalid","status":"error"}
Failed to execute function
- Argument type mismatch - Found 'TEXT' but Expected '[BIGINT]' for the function 'get' Line Number:8
Code:
resp = zoho.crm.getRelatedRecords("Client_Reporting","Locality_Review_777_Data",Id.toLong());
info resp;
total = 0.0;
for each rec in resp
{
total = total + ifnull(rec.get("Net_Profit1"),"0.0").toDecimal();
}
info total;
updateResp = zoho.crm.updateRecord("Locality_Review_777_Data",Id.toLong(),{"Net_Profit":total});
info updateResp;
Can you pelase help me?