Button to Inherit Contact Addres from Account Address not working

Button to Inherit Contact Addres from Account Address not working

Hi All,

Having some issues with a code to inherit the address from an account to a contact. Have the below that's on a button however can't save as it's coming up with the below error message. Any help anyone can offer would be appreciated.

Failed to update function
expecting '}' but found 'void'

Thanks in advance,

  1. void CopyAccountstocontacts(int contactId, int AccountId)
  2. {
  3. contactIdStr = contactId.toString();
  4. AccountDetails = zoho.crm.getRecordById("Accounts",AccountId);
  5. Address Line1 = ifnull(AccountDetails.get("Address Line 1"),"");
  6. Address Line2 = ifnull(AccountDetails.get("Address Line 2"),"");
  7. City/Town = ifnull(AccountDetails.get("City/Town"),"");
  8. State/Province = ifnull(AccountDetails.get("State/Province"),"");
  9. Postcode = ifnull(AccountDetails.get("Postcode"),"");
  10. Country = ifnull(AccountDetails.get("Country"),"");
  11. mp = map();
  12. mp.put("Address Line 1",Address Line1);
  13. mp.put("Address Line 2",Address Line2);
  14. mp.put("City/Town",City/Town);
  15. mp.put("State/Province",State/Province);
  16. mp.put("Postcode",Postcode);
  17. mp.put("Country",Country);
  18. updateResp = zoho.crm.updateRecord("contacts",contactIdStr,mp);
  19. }