I would like to create a custom function that takes the Phone, Mobile & Email field from a contact associated with an account whose Role is Manager (or any contact if there is only one for the account - not sure how to do that aprt) and copy that across to the Phone, Mobile and Email field for the account. How can I accomplish this? I have tried the below script, but I can see no way to find an AccountID field under Contacts that would tell me what AccountID I need to update. So I tried it with the Account Name field, which it doesn't like as it is text and the system is expecting an number. I have this function argument containing both Account and Contact arguments.
- if ( ContactRole == "Manager")
- {
- mp = Map();
- mp.put("Phone",ContactPhone);
- mp.put("Mobile",ContactMobile);
- mp.put("Email",ContactEmail);
- zoho.crm.updateRecord("Accounts",ContactAccountName,mp); //really this needs to be the ID of the Account this contact is associated with, but I can't see an ID for that.
- }
Anyone else come across this? I'm stumped.