Results 1 to 7 of 7

Thread: Multi-Select List

  1. #1
    jagjit is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    51

    Default Multi-Select List

    Hi

    Is it possible that multi-select items can be displayed comined in TextBox . Suppose user selects ItemA,Items B from Multiselect list then it is displayed in textbox as ItemA,ItemB

    Thanx

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Multi-Select List

    Yes it is possible, try the field type multienum. It works exactly as you describled.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    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: Multi-Select List

    Yes, it is possible, but I believe those options are better rendered on multienum field anyway.
    If you really want to do that you can:
    • create a custom view.detail.php on your module;
    • inside this custom view.detail.php implement function preDisplay() in order to modify content of field;
    • edit detailviewdefs.php in order to modify the type of field on layout to "readonly"


    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.

  4. #4
    jagjit is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    51

    Default Re: Multi-Select List

    Hi Rafael

    There is multiselect field i am using C.E . If i have to get this field copied to another customised field . How it can be done , logic hook needs to be written . Can u pls help with logic hook if needs to be written

    Thanx

  5. #5
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Multi-Select List

    If you are developer you can do it with customCode and Javascript or you could use logic hook (before save).
    Last edited by AlexAv; 2012-02-06 at 07:38 AM.
    Letrium ltd. - Only high quality service
    http://letrium.com

  6. #6
    jagjit is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    51

    Default Re: Multi-Select List

    Hi AlexAv

    Can u pls help me with how we can do with Logic Hook

    Thanx

  7. #7
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Multi-Select List

    Example from Sugar Developer Guide – 6.1.0

    Logic Hooks
    Here is some sample code for a simple example of using the logic hooks. This example adds a
    time stamp to the description field of the Media Inquiry every time the record is saved.
    First, create the file AddTimeStamp.php with the following contents.

    PHP Code:
    <?php
    //prevents directly accessing this file from a web browser
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    class 
    AddTimeStamp {
      function 
    StampIt(& $focus$event){
      global 
    $current_user;
      
    $focus->description .= &#8220;\nSaved on ”. date(“Y-m-d g:i a”). “ by ”. $current_user->user_name;
     
    }
    }
    ?>
    Next register this custom function by creating the file logic_hooks.php with the following
    contents.
    PHP Code:
    <?php
    // Do not store anything in this file that is not part of the array or the hook version. This file will
    // be automatically rebuilt in the future.
    $hook_version 1;
    $hook_array = Array();
    // position, file, function
    $hook_array['before_save'] = Array();
    $hook_array['before_save'][] = Array(1'custom''custom/modules/Media/AddTimeStamp.php ','AddTimeStamp',
    'StampIt');
    ?>
    Letrium ltd. - Only high quality service
    http://letrium.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multi Select 6.1.3
    By imran123 in forum Developer Help
    Replies: 6
    Last Post: 2011-03-16, 05:53 PM
  2. Replies: 0
    Last Post: 2010-07-28, 01:38 PM
  3. Replies: 0
    Last Post: 2010-07-26, 10:32 AM
  4. Multi select import
    By madhrishi in forum Help
    Replies: 10
    Last Post: 2009-03-21, 06:53 AM
  5. Different Results from Select and Multi Select
    By dtwing in forum Developer Help
    Replies: 1
    Last Post: 2008-09-26, 02:06 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
  •