Type mismatch for "get" function
Hello,
I have an issue and I am kinda confused by it. I am trying to write a custom function that calculates the sum of all "Invoiced amount" fields and copies it on the related deal.
When I run the function I encounter a type mismatch error:
Data type of the argument of the function 'get' did not match the required data type of '[BIGINT]'
Here is the script:
taskDetails = zoho.crm.getRelatedRecords("Tasks","Deals",dealId.toLong());
suma = 0.0;
for each task in taskDetails
{
suma = suma + ifnull(taskDetails.get("Invoiced_amount"),"0.0").toDecimal();
}
updateResp = zoho.crm.updateRecord("Deals",input.dealId.toLong(),{" Invoiced_amount":suma});
info updateResp;
The Invoiced_amount fields are currency fields.
Is there any way to solve this? What have I done wrong?
Thank you!