Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: add/remove a field based on a checkbox

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default add/remove a field based on a checkbox

    Hi,

    Can I add a checkbox (well I know I can add one) but when it is checked aother date field appears. I think I've read that this is possible by using the devtoolkit - has anyone done this before?

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  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: add/remove a field based on a checkbox

    Yes, DevToolKit can accomplish that request. Version 0.7 has the plugin Visible fields which toggle visibility of fields based on selected value from another field. It workfs for check box, text field and dropdowns.

    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
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: add/remove a field based on a checkbox

    Quote Originally Posted by andopes View Post
    Yes, DevToolKit can accomplish that request. Version 0.7 has the plugin Visible fields which toggle visibility of fields based on selected value from another field. It workfs for check box, text field and dropdowns.

    Cheers
    Hi,

    Is this something that happens right away, so once the check box is ticked the datefield will appear? or is it after a save? I assume that it works for is implying that the field tyes about can be used to trigger it only and are not the only type of fields that can be set to visible?

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  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: add/remove a field based on a checkbox

    Quote Originally Posted by chrislynch8 View Post
    Is this something that happens right away, so once the check box is ticked the datefield will appear?
    Yes, that is it.
    Are you facing any issue on that?

    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
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: add/remove a field based on a checkbox

    Hi Andres

    I've no issue - I've never used you tool so I was just making sure that it would achieve what I required before I invest the time to get it working.

    I'll report back if I run into any more trouble.

    I also see that you can hide panel - I will be implementing this to allow users to create a Meeting from a Call. Again another Checkbox that when ticked will show a seperate panel that will ask for the time and dates of teh meeting and on save create a record.

    Thanks
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  6. #6
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: add/remove a field based on a checkbox

    I've installed the DevToolKit.

    I've configured a custom view.edit.php as per the manual. and I have a metadata file toggle_visible_fields.php but it is not wokring.

    This is a file toggle_visible_fields.php in /custom/modules/<Module>/metadata/

    PHP Code:
    <?php
    //if checkbox_field = 0 higde toggle field
    $toggle_visible_fields.php = array(
                          
    'checkbox_field' => array(
                                             
    '0' => array(
                                                        
    'field_to_toggle' => 0,
                                                     ),
                                             
    '1' => array(
                                                        
    'field_to_toggle' =>1,
                                              ),
                              ),
    );
    ?>
    In the custom view.edit.php I have the following.

    PHP Code:
    private $manager//this is after the Class is defined
        
        
    function init($bean=null$view_object_map=array())
        {
            
    parent::init($bean,$view_object_map);        
            require_once(
    'custom/include/utils/DevToolKitManager.php');        
            
    $this->manager = new DevToolKitManager($this);
        }    
    //I have this in my display function,

    function display() {
        
        
    $this->manager->display();    
            
    $this->ev->process();
    //    echo $this->ev->display();
    //I am doing other stuff in my display here

    //At the end I created the process function

    function process() {
            
    parent::process();
            
    $this->manager->process();
        } 
    I can edit a record so the view is working, the toggle visible fields part is not working

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  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: add/remove a field based on a checkbox

    The variable name should be "$toggle_visible_fields" instead of "$toggle_visible_fields.php".

    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.

  8. #8
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: add/remove a field based on a checkbox

    Thats a typo on my behalf - I have it called toggle_visible_fields with no .php

    Rgds
    Chris
    Last edited by chrislynch8; 2010-03-09 at 11:52 AM. Reason: Bump
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  9. #9
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: add/remove a field based on a checkbox

    Shameful Bump
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  10. #10
    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: add/remove a field based on a checkbox

    Let me know the view.edit.php, editviewefs.php and toggle_visible_fields.php.

    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.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Make field readonly based on field contents?
    By thettenhausen in forum Developer Help
    Replies: 6
    Last Post: 2009-07-24, 09:57 AM
  2. Replies: 2
    Last Post: 2009-04-09, 10:50 AM
  3. Import a checkbox field
    By mtmendez in forum Help
    Replies: 1
    Last Post: 2008-10-17, 08:14 AM
  4. Replies: 12
    Last Post: 2008-06-23, 10:19 AM
  5. Creating Custom Field - Checkbox
    By ethanb in forum Help
    Replies: 2
    Last Post: 2005-07-11, 08:55 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
  •