Copying fields

Copying fields

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. 

  1. if ( ContactRole == "Manager") 
  2. {
  3. mp = Map();
  4. mp.put("Phone",ContactPhone);
  5. mp.put("Mobile",ContactMobile);
  6. mp.put("Email",ContactEmail);
  7. 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.
  8. }

Anyone else come across this? I'm stumped.