Results 1 to 8 of 8

Thread: Changing account in a contact updates the primary address

  1. #1
    tvandesande is offline Member
    Join Date
    Jun 2008
    Posts
    16

    Default Changing account in a contact updates the primary address

    Hello Everyone,

    here's my little problem:
    when i edit a contact, and want to change an account that a contact is connected to, when i try to select a new account, the primary address details of a contact are automatically changed to the primary address of the account i've just selected (this happens upon selecting a new account).
    can anyone help how to cancel this, i just need to change an account, address has to stay the same.

    greetings

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Changing account in a contact updates the primary address

    Hi tvandesande

    Edit the file custom/modules/Contacts/metadata/editviewdefs.php and look for account_name.
    You will find this code:

    PHP Code:
    'displayParams'=>array('key'=>'billing''copy'=>'primary''billingKey'=>'primary''additionalFields'=>array('phone_office'=>'phone_work')) 
    Replace by this one:

    PHP Code:
    'displayParams'=>array('additionalFields'=>array('phone_office'=>'phone_work')) 
    Go to Admin -> Repair -> Quick Repair and Rebuild

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    tvandesande is offline Member
    Join Date
    Jun 2008
    Posts
    16

    Default Re: Changing account in a contact updates the primary address

    Quote Originally Posted by andopes View Post
    Hi tvandesande
    Edit the file custom/modules/Contacts/metadata/editviewdefs.php and look for account_name.
    Hi Andropes,

    unfortunately i don't have metadata directory under /custom/modules/Contacts...
    what do i do now?

    greetings

  4. #4
    tvandesande is offline Member
    Join Date
    Jun 2008
    Posts
    16

    Default Re: Changing account in a contact updates the primary address

    could someone assist me please?
    this is getting pretty urgent for me, i'll appreciate your clues.

  5. #5
    enrashid is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    59

    Default Re: Changing account in a contact updates the primary address

    You can try the following: To create the file, try going to Studio, bring up the Contact module, go to layouts and just modify the editview layout with a small change (anything- bring in a field - you can remove it later). This should create the file since you have now tried to customize the layout. You can then, modify the file as suggested. And then go back to the layout to reverse the change you made.

    Quote Originally Posted by tvandesande View Post
    could someone assist me please?
    this is getting pretty urgent for me, i'll appreciate your clues.

  6. #6
    anamikakhadwal's Avatar
    anamikakhadwal is offline Sugar Community Member
    Join Date
    May 2007
    Location
    India
    Posts
    82

    Default Re: Changing account in a contact updates the primary address

    hi,
    if it custom/modules/Contacts/metadata/editviewdefs.php doesnt exsit..then copy it from modules/Contacts/metadata/editviewdefs.php...and do the respective changes there.


    Thanks
    Anamika

  7. #7
    kamalesh2008 is offline Sugar Community Member
    Join Date
    Mar 2010
    Location
    Pune , India
    Posts
    46

    Default Re: Changing account in a contact updates the primary address

    Hi Andropes,

    we do not want to change contact office phone with account office phone number.

    As i did follow your instructions , but it does not work for me.
    I made a file custom/modules/Contacts/metadata/editviewdefs.php

    FROM
    PHP Code:
    'displayParams'=>array('key'=>'billing''copy'=>'primary''billingKey'=>'primary''additionalFields'=>array('phone_office'=>'phone_work')) 
    TO

    PHP Code:
    'displayParams'=>array('key'=>'billing''copy'=>'primary''billingKey'=>'primary'
    is there any other way?


    please help me.....

    Thank You,
    Kamalesh Dhayal


    Quote Originally Posted by andopes View Post
    Hi tvandesande

    Edit the file custom/modules/Contacts/metadata/editviewdefs.php and look for account_name.
    You will find this code:

    PHP Code:
    'displayParams'=>array('key'=>'billing''copy'=>'primary''billingKey'=>'primary''additionalFields'=>array('phone_office'=>'phone_work')) 
    Replace by this one:

    PHP Code:
    'displayParams'=>array('additionalFields'=>array('phone_office'=>'phone_work')) 
    Go to Admin -> Repair -> Quick Repair and Rebuild

    Cheers
    Thank You
    Kamalesh Dhayal
    SugarCRM Developer
    Pune India
    Skype:kdhayal
    email:kamaleshdhayal2006@gmail.com
    Phone:+918055571304

  8. #8
    madmat is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    Germany
    Posts
    164

    Default Re: Changing account in a contact updates the primary address

    Quote Originally Posted by andopes View Post
    Hi tvandesande
    Edit the file custom/modules/Contacts/metadata/editviewdefs.php and look for account_name.
    You will find this code:
    PHP Code:
    'displayParams'=>array('key'=>'billing''copy'=>'primary''billingKey'=>'primary''additionalFields'=>array('phone_office'=>'phone_work')) 
    Replace by this one:
    PHP Code:
    'displayParams'=>array('additionalFields'=>array('phone_office'=>'phone_work')) 
    This is true for the auto complete function.
    But not the popup.
    For some reason the popup overrides the "additional fields" - but I never figured out where.
    I dumped tons of JS code, tried the popup defs of accounts and contacts, it´s still there.
    If anybody has an idea on that?

    Ok, this had me started again:
    in:
    include\SugarFields\Fields\Relate\SugarFieldRelate .php
    there´s:
    PHP Code:
     if($copy_phone) {
                  
    $popup_request_data['field_to_name_array']['phone_office'] = 'phone_work';
                } 
    Uncommenting it solves the problem.
    Phone Office is no longer written into Phone Work of the contact, using the popup to relate an account.

    The upgrade safe way to achieve it should be either to set "$copy_phone=0" (anybody how&where?) while calling the popup or something like this to put phone_work in phone_other:
    PHP Code:
    array (
                
    'name' => 'account_name',
                
    'displayParams' => 
                array (             
                  
    'additionalFields' => 
                  array(
    'phone_office'=>'phone_other'
                  
    ),
                  
    'field_to_name_array' => 
                  array(
    'phone_office'=>'phone_other'
                  
    ),              
                ), 
    in custom/../editvewdefs.php.

    I´ll try and report...
    Last edited by madmat; 2010-12-13 at 03:33 PM. Reason: addition made

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. can't add email address to contact or account
    By mikesolomon in forum Help
    Replies: 7
    Last Post: 2009-09-21, 11:06 AM
  2. Contact and Account address
    By People3 in forum Help
    Replies: 6
    Last Post: 2008-11-26, 06:39 PM
  3. Account copies address to Contact
    By NateL in forum Developer Help
    Replies: 2
    Last Post: 2008-11-07, 04:24 PM
  4. Changing Link between Account and Contact
    By kevincdaughtry in forum Developer Help
    Replies: 3
    Last Post: 2006-03-24, 10:38 PM
  5. Replies: 0
    Last Post: 2005-04-22, 12:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •