Field_to_name_array with flex_relate to Contacts or Accounts

I am hoping this is NOT the final answer to using a Flex_Relate field, but, as described in

one way to kludge this to work would be to create a before_save logic hook for Accounts and create fields in Accounts which have the same name as the fields in the Contacts and copy the relevant Account information into thse duplicate fileds.

  • Set new Accounts field primary_address_street = billing_address_street
  • Set new Accounts field primary_address_city = billing_address_city

Use primary_address_street and primary_address_city regardless of whether the user selcts Accounts or Contacts.

Hopefully there is a better solution that comeone can suggest becuase this is pure kludge and very restrictive.