I am trying to update a contact record in Zoho CRM from Zoho books with the below script but it gives the above error:
//This is a sample function. Uncomment to execute or make changes to this function.
invoiceID = invoice.get("invoice_id");
invoicedate = invoice.get("date").toDate();
organizationID = organization.get("organization_id");
PaidQty = invoice.get("line_items").get(0).get("quantity");
InvoiceOwner = zoho.books.getRecordsByID("contacts",organizationID,invoice.get("customer_id"),"books");
CRMContact = InvoiceOwner.get("contact").get("zcrm_contact_id");
MealCredit = zoho.crm.getRecordById("contacts",CRMContact,"crm").get("Meal_Credits");
newTotal = PaidQty + MealCredit;
info CRMContact;
info InvoiceOwner;
contactMap = map();
contactMap.put("Fax", "12121");
zoho.crm.updateRecord("contacts", CRMContact, contactMap,"crm");