Results 1 to 8 of 8

Thread: Autocomplete contacts behavior

  1. #1
    tron90 is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    19

    Post Autocomplete contacts behavior

    Hi,
    Newbie question, I hope you can help me.
    I'm having some trouble with autocomplete. when making a note I start typing the contact name but for some reason the autocomplete lists only the last names.
    So if I have John Smith and start typing "JOHN" I only get Smith in the drop down (not "john smith") which does not make any sense. I want both First and Last Name to appear in the autocomplete, otherwise it is not possible to fill the contact properly.

    Also, is there any way to change the autocomplete delay?. Because now, if I stop writing for a couple of seconds my fields gets populated with the first result of the drop down (eg. "Smith"). This two problems make it really difficult to complete this field. Please tell me if I am doing something wrong, or if I need to change any code to get the behavior that I want.

    Thank you!

  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: Autocomplete contacts behavior

    You need to create an extended vardefs for your module, which contains Contacts relate field, and add an entry like that:

    PHP Code:
    $dictionary['<Bean Name>']['fields']['<contact relate field name>']['rname'] = 'name'
    Obviously replace <Bean Name> and <contact relate field name> by the appropriate values.

    Go to Admin -> Repair -> Quick Repair and Rebuild
    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
    tron90 is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    19

    Default Re: Autocomplete contacts behavior

    Thank you,
    Here's what I did, please correct me because it's still not working properly.

    I added the file sugar/custom/modules/Notes/Ext/Vardefs/vardefs.ext.php with this contents

    <?php

    $dictionary['Notes']['fields']['contact_notes']['rname'] = 'name';

    ?>

    However, after repairing, the file dissappears and there is no change.

    Can you please tell me what am I doing wrong?

  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: Autocomplete contacts behavior

    Correct file is custom/Extension/modules/Notes/Ext/Vardefs/somescript.php

    Correct content is:

    PHP Code:
    <?php 
    $dictionary
    ['Note']['fields']['contact_notes']['rname'] = 'name'
    ?>
    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
    tron90 is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    19

    Default Re: Autocomplete contacts behavior

    Ok,
    After repairing the file doesn't dissapear anymore. But the autocomplete behavior is still the same.
    I want the drop down menu to list 'name', as it is now it only lists 'last_name' and that's the cause of the problem.



    Any ideas on how I can do this?

  6. #6
    tron90 is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    19

    Default Re: Autocomplete contacts behavior

    Any clues?

    I have no idea how to solve this, any help will be much appreciated.

  7. #7
    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: Autocomplete contacts behavior

    I made a mistake.

    Replace the code I provided you previously by this one:

    PHP Code:
    $dictionary['Note']['fields']['contact_name']['rname'] = 'name'
    Then go to Admin -> Repair -> Quick Repair and Rebuild

    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.

  8. #8
    tron90 is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    19

    Default Re: Autocomplete contacts behavior

    Great, that solved it!

    Thank you

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. autocomplete fields not working in contacts module
    By kamalesh2008 in forum Developer Help
    Replies: 0
    Last Post: 2010-08-30, 02:21 PM
  2. Replies: 0
    Last Post: 2009-07-28, 07:05 AM
  3. Autocomplete in team
    By kalaisugar in forum Developer Help
    Replies: 2
    Last Post: 2009-07-02, 06:43 AM
  4. Autocomplete?
    By sagarladdha in forum Help
    Replies: 0
    Last Post: 2006-11-09, 04:32 AM
  5. Replies: 0
    Last Post: 2006-07-25, 11:45 AM

Tags for this Thread

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
  •