Hi bilguun,
You can try this,
Code:
update contacts c, accounts a, accounts_contacts ac
set c.primary_address_city = a.billing_address_city
where a.id = ac.account_id and ac.contact_id = c.id and (c.primary_address_city = '' OR c.primary_address_city is null)
update contacts c, accounts a, accounts_contacts ac
set c.primary_address_state = a.billing_address_state
where a.id = ac.account_id and ac.contact_id = c.id and (c.primary_address_state = '' OR c.primary_address_state is null)
update contacts c, accounts a, accounts_contacts ac
set c.primary_address_country = a.billing_address_country
where a.id = ac.account_id and ac.contact_id = c.id and (c.primary_address_country = '' OR c.primary_address_country is null)
update contacts c, accounts a, accounts_contacts ac
set c.primary_address_postalcode = a.billing_address_postalcode
where a.id = ac.account_id and ac.contact_id = c.id and (c.primary_address_postalcode = '' OR c.primary_address_postalcode is null)
I know tis is a dirty way of doing things but should server the purpose.
Please use it at your own risk.
Thanks
Vasi.
Bookmarks