I am struggling to get this function to work no matter what changes I make - this is the constant error (my code is 30 lines long):
Data type of the argument of the function 'get' did not match the required data type of '[BIGINT]'at lineNumber 31
I am trying to figure out what could be wrong - my only theory being Lookup modules not producing BIGINT Data types.
The general idea is to update Client Product Contacts module when certain fields in Contacts are updated (one way sync).
This is the code:
contactId = input.id;
// Get Contact record
contactRec = zoho.crm.getRecordById("Contacts",contactId);
info contactRec.toString();
// Extract fields
firstName = contactRec.get("First_Name");
lastName = contactRec.get("Last_Name");
email = contactRec.get("Email");
company = contactRec.get("Account_Name");
// Owner as BIGINT
ownerId = contactRec.get("Owner");
// Do NOT use .get("id")
// Find related records
relatedRecords = zoho.crm.searchRecords("Client_Product_Contact","(Contact:equals:" + contactId + ")");
info relatedRecords.toString();
// Update related records
for each rec in relatedRecords
{
updateMap = Map();
updateMap.put("First_Name",firstName);
updateMap.put("Last_Name",lastName);
updateMap.put("Report_Email",email);
updateMap.put("Client_Company_Name",company);
// Lookup fields
updateMap.put("Distribution_contacts",{"id":contactId});
updateMap.put("Owner",{"id":ownerId});
// ownerId as string
// Update record safely
zoho.crm.updateRecord("Client_Product_Contact",rec.get("id"),updateMap);
}
Let me know if this is solvable,
Marcus