Issue getting related record data

Issue getting related record data

Hi I am having some issues in Zoho CRM using relatedrecord information in a function.

I have a function that uses the account id to pull via getRelatedRecords associated information from a custom module called Sales Contracts (api = Customer_Reference1) as shown in the below code, and resulting info the function runs and info shows the found values for the associated record but when I try to use any of the field values it throws and exception saying [Failed to execute function
  • Data type of the argument of the function 'get' did not match the required data type of '[BIGINT]' Line Number:9]
  • And I cant get passed it, I am trying to update two fields in the Accounts module - SW_Contract_No and Contract_Status
  • with the values found in the getrelatedrecords query in fields  and "Name" and "Status"

here is my code thus far: 
  1. respMap = zoho.crm.getRecordById("Accounts", accid.tolong());
  2. info respMap;
  3. //respMap2 = zoho.crm.getRecordById("Sales_Contract", scid.tolong());
  4. //info respMap2;

  5. respMap2 = zoho.crm.getRelatedRecords("Customer_Reference1", "Accounts", accid.tolong());
  6. info respMap2;
  7. ContractNo = ifnull(respMap2.get("Name"),"");
  8. status = ifnull(respMap2.get("Status"),"");
  9. if(Account_Name != null)
  10. {

  11. mp = Map();
  12. mp.put("SW_Contract_No",toString(ContractNo));
  13. mp.put("Contract_Status",toString(status));
  14. update = zoho.crm.updateRecord("Accounts",accid.tolong(),mp);
  15. info mp;
  16. info update;
  17. }
This is the result i get at the moment :-(

Info
  • {"GE_Account":"13460-1","Days_Remaining":"189","Awaiting_Sign":false,"Delivery_Address":null,"Owner":{"name":"Simon Butler","id":"4993102000000687005","email":""},"Action":"New","Parent_Account_No":"13460","$currency_symbol":"NZ$","$field_states":null,"$review_process":{"approve":false,"reject":false,"resubmit":false},"End_Date":"2023-11-30","Manager":{"name":"Ryan Scholes","id":"4993102000000344010"},"SW_Mill":"Morrinsville","Name":"20088068","Last_Activity_Time":"2023-05-25T00:30:08+12:00","Record_Image":null,"$review":null,"$state":"save","Unsubscribed_Mode":null,"$process_flow":false,"Exchange_Rate":1,"Currency":"NZD","$locked_for_me":false,"Account_Name":{"name":"MS and ML Vickers-1","id":"4993102000087176564"},"id":"4993102000087354790","Memo_Debtor":"Farm Source Te Awamutu","Start_Date":"2023-05-29","Total_Contract_Tonnes":144,"$approved":true,"Status":"Awaiting Start","$approval":{"delegate":false,"approve":false,"reject":false,"resubmit":false},"Unsubscribed_Time":null,"$editable":true,"Sign_Buyer":false,"Created_date":"2023-05-25","Total_Remaining_Tonnes":144,"$orchestration":false,"Parent_Account":{"name":"MS and ML Vickers","id":"4993102000087178558"},"$in_merge":false,"Locked__s":false,"Pick_List_5":null,"GE_External_No":"20088068","Tag":[],"$zia_owner_assignment":"owner_recommendation_unavailable","$approval_state":"approved"}
Failed to execute function
  • Data type of the argument of the function 'get' did not match the required data type of '[BIGINT]' Line Number:9
Can anyone help me overcome this please?