Results 1 to 5 of 5

Thread: displayParams strange behavior

  1. #1
    zacc is offline Member
    Join Date
    Apr 2009
    Posts
    8

    Default displayParams strange behavior

    hi,

    I put the following code (*) to custom/modules/Cases/metadate/editviewdefs.php:

    array (
    'name' => 'account_name',
    'label' => 'LBL_ACCOUNT_NAME',
    'tabindex' => '2',
    'displayParams' =>
    array (
    'readOnly' => true,
    'size'=>60,
    'field_to_name_array' => array(
    'id' => 'account_id',
    'name' => 'account_name',
    'source_code_c' => 'source_code_c',
    ),
    'additionalFields' => array(
    'source_code_c' => 'source_code_c',
    ),
    ),
    ),

    this works well, source_code_c field is updated.

    I copied the idea to custom/modules/Contacts/metadata/editviewdefs.php where the original code (**) was this:

    array (
    'name' => 'account_name',
    'label' => 'LBL_ACCOUNT_NAME',
    'tabindex' => '3',
    'displayParams' =>
    array (
    'readOnly' => true,
    'size' => 60,
    'key' => 'billing',
    'copy' => 'primary',
    'billingKey' => 'primary',
    'additionalFields' =>
    array (
    'phone_office' => 'phone_work',
    ),
    ),
    ),

    the new code (***) is:

    array (
    'name' => 'account_name',
    'label' => 'LBL_ACCOUNT_NAME',
    'tabindex' => '3',
    'displayParams' =>
    array (
    'readOnly' => true,
    'size' => 60,
    'key' => 'billing',
    'copy' => 'primary',
    'billingKey' => 'primary',
    'field_to_name_array' =>
    array (
    'id' => 'account_id',
    'name' => 'account_name',
    'source_code_c' => 'source_code_c',
    ),
    'additionalFields' =>
    array (
    'source_code_c' => 'source_code_c',
    'phone_office' => 'phone_work',
    ),
    ),
    ),

    the source_code_c field update is ignored while address and phone fields work well.

    if I cut the original code to this (****):


    array (
    'name' => 'account_name',
    'label' => 'LBL_ACCOUNT_NAME',
    'tabindex' => '3',
    'displayParams' =>
    array (
    'readOnly' => true,
    'size'=>60,
    'field_to_name_array' => array(
    'id' => 'account_id',
    'name' => 'account_name',
    'source_code_c' => 'source_code_c',
    ),
    'additionalFields' => array(
    'source_code_c' => 'source_code_c',
    ),
    ),
    ),

    source_code_c works well and of course the address and telephone fileds are not updated.

    the really strange thing if I cut the phone_office line from code (***) the telephone number is still updated. it seems sugarcrm ignores my custom code in this case and use something else.

    what the hell is happening?

  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: displayParams strange behavior

    Hi zacc

    Which version are you using?

    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
    zacc is offline Member
    Join Date
    Apr 2009
    Posts
    8

    Default Re: displayParams strange behavior

    hello

    SugarCRM Enterprise Edition Version 5.2.0a (Build 5447)
    (Ubuntu Server+Oracle 10g)

    first we started on SugarCRM CE 5.1. as I remember some custom codes had been copied to the new install. maybe this action causes the malfunction...

  4. #4
    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: displayParams strange behavior

    Try to reproduce this in a fresh install containing demo data and the custom field you added in both Contacts and Accounts.
    Let us know the result.

    Kind regards
    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.

  5. #5
    zacc is offline Member
    Join Date
    Apr 2009
    Posts
    8

    Default Re: displayParams strange behavior

    Hi,

    Well, it's not allowed to create a fresh install. So I made it dirty.

    I changed the displayParams to:

    'displayParams' =>
    array (
    'readOnly' => true,
    'size'=>60,
    'field_to_name_array' => array(
    'id' => 'account_id',
    'name' => 'account_name',
    'source_code_c' => 'source_code_c',
    'phone_office' => 'phone_work',
    'billing_address_city' => 'primary_address_city',
    'billing_address_street' => 'primary_address_street',
    'billing_address_country' => 'primary_address_country',
    'billing_address_postalcode' => 'primary_address_postalcode',
    'billing_address_street_from_c' => 'primary_address_street_from_c',
    'billing_address_street_to_c' => 'primary_address_street_to_c',
    'billing_address_building_c' => 'primary_address_building_c',
    'billing_address_staircase_c' => 'primary_address_staircase_c',
    'billing_address_floor_c' => 'primary_address_floor_c',
    'billing_address_door_c' => 'primary_address_door_c',
    ),
    'additionalFields' => array(
    'source_code_c' => 'source_code_c',
    'phone_office' => 'phone_work',
    'billing_address_city' => 'primary_address_city',
    'billing_address_street' => 'primary_address_street',
    'billing_address_country' => 'primary_address_country',
    'billing_address_postalcode' => 'primary_address_postalcode',
    'billing_address_street_from_c' => 'primary_address_street_from_c',
    'billing_address_street_to_c' => 'primary_address_street_to_c',
    'billing_address_building_c' => 'primary_address_building_c',
    'billing_address_staircase_c' => 'primary_address_staircase_c',
    'billing_address_floor_c' => 'primary_address_floor_c',
    'billing_address_door_c' => 'primary_address_door_c',
    ),


    I think this section makes the problem:
    'key' => 'billing',
    'copy' => 'primary',
    'billingKey' => 'primary',


    If I use this my code is disabled and something else is used (I had not found yet where the key-based copy code). I made three tries and chacked the page source:

    1. key-based copy:
    onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"Ed itView","field_to_name_array":{"id":"account_id"," name":"account_name","billing_address_street":"pri mary_address_street","billing_address_city":"prima ry_address_city","billing_address_state":"primary_ address_state","billing_address_postalcode":"prima ry_address_postalcode","billing_address_country":" primary_address_country","phone_office":"phone_wor k"}}, "single", true);'>

    2. without key-based copy the rest:
    onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"Ed itView","field_to_name_array":{"id":"account_id"," name":"account_name","source_code_c":"source_code_ c","phone_office":"phone_office"}}, "single", true);'>

    3. without key-based copy but with hand-made address:
    onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"Ed itView","field_to_name_array":{"id":"account_id"," name":"account_name","source_code_c":"source_code_ c","phone_office":"phone_work","billing_address_ci ty":"primary_address_city","billing_address_street ":"primary_address_street","billing_address_countr y":"primary_address_country","billing_address_post alcode":"primary_address_postalcode","billing_addr ess_street_from_c":"primary_address_street_from_c" ,"billing_address_street_to_c":"primary_address_st reet_to_c","billing_address_building_c":"primary_a ddress_building_c","billing_address_staircase_c":" primary_address_staircase_c","billing_address_floo r_c":"primary_address_floor_c","billing_address_do or_c":"primary_address_door_c"}}, "single", true);'>

    So if key-based copy is inside the open_popup comes from somewhere else. If there is a less dirty method please tell me.

    thanx

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Strange AJAX auto complete behavior
    By Mithun in forum Developer Help
    Replies: 1
    Last Post: 2009-04-22, 06:00 PM
  2. Strange SQL behavior on custom modules
    By enicot in forum Developer Help
    Replies: 3
    Last Post: 2009-02-23, 09:36 PM
  3. Replies: 3
    Last Post: 2008-09-16, 02:20 PM
  4. Replies: 2
    Last Post: 2006-07-28, 11:50 AM
  5. User Admin - Strange Behavior
    By mnaish in forum Help
    Replies: 0
    Last Post: 2005-01-26, 06:17 PM

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
  •