do not update phone_work in Contact EditView while selecting account

Hi,

how can i disable the updating of phone_work while selecting a new account in the contacts-DetailView?

i already removed the additinalFields Array in the Contacts editviewdefs.php but the phone_work field still gets updated after selecting a new account.

regards

I’m not sure I understand. You mean it uses the phone number from the Account to automatically populate in the Contact?

yes.

if i am editing a an existing contact and connect this contact with a new Account some details of the account (address and phone of account) will be updated in the editview fields of the current account.

but i don`t want that also phone number will bei automatically updated.

regards

I didn’t know this “feature” existed.

I spent some time looking for this in the code but I couldn’t find it, sorry…

It should be pretty simple to tweak once you know where it’s happening…

found the solution in the code.

you can set a displayParams value called copyPhone. set this to false in the account_name field in editviewdefs.php and the phone number will no more be copied.

but then you also have to change the value of the NTC_OVERWRITE_ADDRESS_PHONE_CONFIRM language label.

1 Like

That’s it, thanks for sharing.

Before doing this change, were you getting a confirmation dialog box before the value was copied? The one with that NTC_OVERWRITE_ADDRESS_PHONE_CONFIRM message?

And where do you change that displayParams thing? Is there some config file or do you just change it there in the code, near the place where it’s used?

yes i get the confirm dialog with NTC_OVERWRITE_ADDRESS_PHONE_CONFIRM message.

i still get the confirm-dialog after my modifications but i change the message and removed the phone-message part (in include/languages/XX_XX.php (depending on your language)

the displayParams was changed in custom/modules/Contacts/metadata/editviewdefs.php

'name' => 'account_name',
            'displayParams' => 
            array (
			  'copyPhone' => false,
              'key' => 'billing',
              'copy' => 'primary',
              'billingKey' => 'primary',
      
            ),
1 Like