Results 1 to 5 of 5

Thread: onchange relate field help

  1. #1
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default onchange relate field help

    in this post http://www.sugarcrm.com/forums/showthread.php?t=36213 andopes said to copy the folder relate as relateonchange and edit the editviewdefs.php which i did but now i dont understand where to put the
    PHP Code:
    'type' => 'new_type' 
    or what to put in 'new_type'

    any help would be appreciated

  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: onchange relate field help

    Quote Originally Posted by blitz2190 View Post
    in this post http://www.sugarcrm.com/forums/showthread.php?t=36213 andopes said to copy the folder relate as relateonchange and edit the editviewdefs.php which i did but now i dont understand where to put the
    PHP Code:
    'type' => 'new_type' 
    or what to put in 'new_type'

    any help would be appreciated
    At the editviewdefs.php, of the module you want to add an javascript event on a relate field, you need to add this code into relate field definition:

    PHP Code:
                            array(
                                
    'name' => 'the_field',
                                
    'type' => 'relateonchange',
                                
    'label' => 'LBL_THE_LABEL',
                            ), 
    Remember to Quick Repair and Rebuild after saving the file.

    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.

  3. #3
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default Re: onchange relate field help

    Ok i tried to do this but i think I'm misunderstanding where to put the event in this line
    PHP Code:
    <input type="text" name="{{sugarvar key='name'}}" class={{if empty($displayParams.class) }}"sqsEnabled"{{else}} "{{$displayParams.class}}" {{/if}} tabindex="{{$tabindex}}" id="{{sugarvar key='name'}}" size="{{$displayParams.size}}" value="{{sugarvar key='value'}}" title='{{$vardef.help}}' autocomplete="off" {{$displayParams.readOnly}} {{$displayParams.field}}> 
    where would i put the on change function

    *edit*

    i add this to the above after looking through other fields
    PHP Code:
    {{if isset($displayParams.javascript)}}{{$displayParams.javascript}}{{/if}} 
    Last edited by blitz2190; 2009-08-17 at 01:03 PM. Reason: fonud solution

  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: onchange relate field help

    Have a look at this bug on bug tracker.
    It is a feature I had suggested which accomplish your needs.

    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.

  5. #5
    sreekanths478 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    hyderabad
    Posts
    19

    Default Re: onchange relate field help

    Hi,

    I am having accounts relation in custom module.i have turn off auto suggestion for this field.

    can you help me on this.



    Quote Originally Posted by andopes View Post
    At the editviewdefs.php, of the module you want to add an javascript event on a relate field, you need to add this code into relate field definition:

    PHP Code:
                            array(
                                
    'name' => 'the_field',
                                
    'type' => 'relateonchange',
                                
    'label' => 'LBL_THE_LABEL',
                            ), 
    Remember to Quick Repair and Rebuild after saving the file.

    Regards

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. add js onchange to relate field
    By mikesolomon in forum Developer Help
    Replies: 5
    Last Post: 2010-09-09, 08:49 AM
  2. Replies: 6
    Last Post: 2010-03-05, 12:38 PM
  3. Get the ID of a relate field
    By Mr.X in forum Developer Help
    Replies: 2
    Last Post: 2009-02-12, 07:34 AM
  4. relate Field -> Search Field
    By Mr.X in forum Developer Help
    Replies: 2
    Last Post: 2009-02-05, 07:04 AM
  5. relate field
    By user1000 in forum Developer Help
    Replies: 0
    Last Post: 2008-07-01, 11:08 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
  •