Results 1 to 8 of 8

Thread: Adding fields to activity subpanel Sugar 6

  1. #1
    abhax's Avatar
    abhax is offline Senior Member
    Join Date
    Jun 2010
    Location
    India
    Posts
    65

    Smile Adding fields to activity subpanel Sugar 6

    Hi people,

    Did something new today, thought share with the sugar community.
    I added a field to the activity sub-panel.
    This activity does not appear on the studio so we need to do some code and copy some files in custom to do so.

    Here is what i did to add a description field to activity sub panel.

    Steps to follow:-

    1. modules/Tasks/metadate/subpanels/ForActivities.php copy this file and add to custom/module/Tasks/metadate/subpanels/ForActivities.php, create the folder structure if it aint present.

    2. Modify this ForActivities.php in the custom/Tasks/metadata/subpanels/ForActivities.php
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    $subpanel_layout = array(
        
    //Removed button because this layout def is a component of
        //the activities sub-panel.

        
    'where' => "(tasks.status='Not Started' OR tasks.status='In Progress' OR tasks.status='Pending Input')",
        
        
                    
        
    'list_fields' => array(
            
    'object_image'=>array(
                
    'vname' => 'LBL_OBJECT_IMAGE',
                
    'widget_class' => 'SubPanelIcon',
                  
    'width' => '2%',
            ),
            
    'close_button'=>array(
                
    'widget_class' => 'SubPanelCloseButton',
                
    'vname' => 'LBL_LIST_CLOSE',
                
    'width' => '6%',
                
    'sortable'=>false,
            ),
            
    'name'=>array(
                 
    'vname' => 'LBL_LIST_SUBJECT',
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'width' => '30%',
            ),
                    
    'description'=>array(
                 
    'vname' => 'description',
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'width' => '30%',
            ),
            
    'status'=>array(
                 
    'widget_class' => 'SubPanelActivitiesStatusField',
                 
    'vname' => 'LBL_LIST_STATUS',
                 
    'width' => '15%',
            ),
            
    'contact_name'=>array(
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'target_record_key' => 'contact_id',
                 
    'target_module' => 'Contacts',
                 
    'module' => 'Contacts',
                 
    'vname' => 'LBL_LIST_CONTACT',
                 
    'width' => '11%',
            ),
            
    'date_due'=>array(
                 
    'vname' => 'LBL_LIST_DUE_DATE',
                 
    'width' => '10%',
                 
    'alias' => 'date_start',
                 
    'sort_by' => 'date_start',
            ),
            
    'assigned_user_name' => array (
                
    'name' => 'assigned_user_name',
                
    'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
            ),
            
    'edit_button'=>array(
                
    'vname' => 'LBL_EDIT_BUTTON',
                 
    'widget_class' => 'SubPanelEditButton',
                 
    'width' => '2%',
            ),
            
    'remove_button'=>array(
                
    'vname' => 'LBL_REMOVE',
                 
    'widget_class' => 'SubPanelRemoveButton',
                 
    'width' => '2%',
            ),
            
    'time_due'=>array(
                
    'usage'=>'query_only',
                 
    'alias' => 'time_start'    
            
    )    ,
            
        ),
    );        
    ?>
    I added the description field to the subpanel for tasks.

    3. Similarly do the same for the Meeting and Calls. Just Copy the file from subpanels in modules to there respective folders in custom and modify the code.

    And Magic! you will see an additional field in activity subpanel, in the example its description.
    Plz feel free to rectify any thing that is wrong or i have missed out.


    Hope it is helpful !!!
    If It Is To Be, It Is Up To Me

  2. #2
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Default Re: Adding fields to activity subpanel Sugar 6

    Hello !!!!!!!!!!

    Really nice work ,you are a magician . keep it up ... keep sharing

  3. #3
    abhax's Avatar
    abhax is offline Senior Member
    Join Date
    Jun 2010
    Location
    India
    Posts
    65

    Smile Re: Adding fields to activity subpanel Sugar 6

    Hi sir,

    Just sharing what i can with the sugar community.
    Thanks
    ^_^
    If It Is To Be, It Is Up To Me

  4. #4
    gmichael7's Avatar
    gmichael7 is offline Member
    Join Date
    Dec 2010
    Posts
    5

    Default Re: Adding fields to activity subpanel Sugar 6

    You guys are all magicians to me. I just started here 2 days ago, and have no programming experience. I'm trying to figure out how to add a date stamped notes capability (just like in Activities) to a custom module that I built. I thought I would be able to pull up 'Activities' as a Subpanel in my custom module, but under 'Available Subpanels' there's just 'Default'.

    Can anybody help me here?

    Thanks,

  5. #5
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: Adding fields to activity subpanel Sugar 6

    Quote Originally Posted by abhax View Post
    Hi people,

    Did something new today, thought share with the sugar community.
    I added a field to the activity sub-panel.
    This activity does not appear on the studio so we need to do some code and copy some files in custom to do so.

    Here is what i did to add a description field to activity sub panel.

    Steps to follow:-

    1. modules/Tasks/metadate/subpanels/ForActivities.php copy this file and add to custom/module/Tasks/metadate/subpanels/ForActivities.php, create the folder structure if it aint present.

    2. Modify this ForActivities.php in the custom/Tasks/metadata/subpanels/ForActivities.php
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    $subpanel_layout = array(
        
    //Removed button because this layout def is a component of
        //the activities sub-panel.

        
    'where' => "(tasks.status='Not Started' OR tasks.status='In Progress' OR tasks.status='Pending Input')",
        
        
                    
        
    'list_fields' => array(
            
    'object_image'=>array(
                
    'vname' => 'LBL_OBJECT_IMAGE',
                
    'widget_class' => 'SubPanelIcon',
                  
    'width' => '2%',
            ),
            
    'close_button'=>array(
                
    'widget_class' => 'SubPanelCloseButton',
                
    'vname' => 'LBL_LIST_CLOSE',
                
    'width' => '6%',
                
    'sortable'=>false,
            ),
            
    'name'=>array(
                 
    'vname' => 'LBL_LIST_SUBJECT',
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'width' => '30%',
            ),
                    
    'description'=>array(
                 
    'vname' => 'description',
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'width' => '30%',
            ),
            
    'status'=>array(
                 
    'widget_class' => 'SubPanelActivitiesStatusField',
                 
    'vname' => 'LBL_LIST_STATUS',
                 
    'width' => '15%',
            ),
            
    'contact_name'=>array(
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'target_record_key' => 'contact_id',
                 
    'target_module' => 'Contacts',
                 
    'module' => 'Contacts',
                 
    'vname' => 'LBL_LIST_CONTACT',
                 
    'width' => '11%',
            ),
            
    'date_due'=>array(
                 
    'vname' => 'LBL_LIST_DUE_DATE',
                 
    'width' => '10%',
                 
    'alias' => 'date_start',
                 
    'sort_by' => 'date_start',
            ),
            
    'assigned_user_name' => array (
                
    'name' => 'assigned_user_name',
                
    'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
            ),
            
    'edit_button'=>array(
                
    'vname' => 'LBL_EDIT_BUTTON',
                 
    'widget_class' => 'SubPanelEditButton',
                 
    'width' => '2%',
            ),
            
    'remove_button'=>array(
                
    'vname' => 'LBL_REMOVE',
                 
    'widget_class' => 'SubPanelRemoveButton',
                 
    'width' => '2%',
            ),
            
    'time_due'=>array(
                
    'usage'=>'query_only',
                 
    'alias' => 'time_start'    
            
    )    ,
            
        ),
    );        
    ?>
    I added the description field to the subpanel for tasks.

    3. Similarly do the same for the Meeting and Calls. Just Copy the file from subpanels in modules to there respective folders in custom and modify the code.

    And Magic! you will see an additional field in activity subpanel, in the example its description.
    Plz feel free to rectify any thing that is wrong or i have missed out.


    Hope it is helpful !!!
    Hi and thanks for posting this. I have some questions though.

    I am trying to edit the Subpanel in the standard modules, not custom, so have tried following your notes as I assume it would be the same. To cut a long story short, I cannot get it to work properly. I have managed to get the description field to show but the width % does not appear to have any bearing on the view and I am unable to show a field header above the actual description.

    I am currently scouring the documentation for developers but struggling a bit with it. Can you perhaps shed any light on why this doesn't work properly? I have copied the text as per your example.
    Currently using version 6.0.2 of Sugar

    Your help appreciated
    Thanks
    Matt

  6. #6
    KenP is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    20

    Default Re: Adding fields to activity subpanel Sugar 6

    I was able to get the above example to work with the 'description' field for meetings, however, I would like to put a custom field that I have on meeting in the list as well.

    I followed the same format and although I get the column and header to show up, it doesnt show any data.

    I have the following with meeting_type_c being my custom field. Is there another file I need to update to be able to use custom fields?

    'meeting_type_c' => array(
    'vame'=>'Meeting Type',
    'widget_class'=>''SubPanelDetailViewLink',
    'width'=>'30%'
    ),

    --------
    I also tried removing the
    'widget_class'=>''SubPanelDetailViewLink',
    ... and got the same results. This is a dropdown field and not sure if I'm suppose to use something else for the 'widget_class'?

    Any thoughts?

  7. #7
    jonessteven is offline Junior Member
    Join Date
    Feb 2012
    Posts
    3

    Default Re: Adding fields to activity subpanel Sugar 6

    Can anyone please tell me how to remove the date created list from the history tab?
    please please please help...

    Thanks in advance

  8. #8
    crmwa_alexon Guest

    Question Re: Adding fields to activity subpanel Sugar 6

    Hello all,

    How about if I have a custom module and every time I create a record it display to history subpanel..

    Example in "Account module" history subpanel.

    How should I implement this issue?

    Please help me.

    Thanks!

    Alexon

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 2010-09-08, 06:43 PM
  2. Adding custom fields to History Subpanel
    By cmcassity10 in forum Help
    Replies: 8
    Last Post: 2010-04-05, 05:59 PM
  3. Adding import fields in Sugar?
    By Czrrin in forum General Discussion
    Replies: 2
    Last Post: 2009-08-03, 03:27 PM
  4. Replies: 4
    Last Post: 2006-07-19, 03:10 PM
  5. Replies: 3
    Last Post: 2006-04-05, 12:12 PM

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
  •