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,
- void CopyAccountstocontacts(int contactId, int AccountId)
- {
- contactIdStr = contactId.toString();
- AccountDetails = zoho.crm.getRecordById("Accounts",AccountId);
- Address Line1 = ifnull(AccountDetails.get("Address Line 1"),"");
- Address Line2 = ifnull(AccountDetails.get("Address Line 2"),"");
- City/Town = ifnull(AccountDetails.get("City/Town"),"");
- State/Province = ifnull(AccountDetails.get("State/Province"),"");
- Postcode = ifnull(AccountDetails.get("Postcode"),"");
- Country = ifnull(AccountDetails.get("Country"),"");
- mp = map();
- mp.put("Address Line 1",Address Line1);
- mp.put("Address Line 2",Address Line2);
- mp.put("City/Town",City/Town);
- mp.put("State/Province",State/Province);
- mp.put("Postcode",Postcode);
- mp.put("Country",Country);
- updateResp = zoho.crm.updateRecord("contacts",contactIdStr,mp);
- }