Results 1 to 4 of 4

Thread: Custom field on a subpanel

  1. #1
    arasdeveloper2 is offline Senior Member
    Join Date
    Jan 2009
    Posts
    33

    Question Custom field on a subpanel

    Hi,
    I have insert a custom field on "Calls" form. This field is memorized in calls_cstm table. I like insert this field as column of the Acitivities subpanel in the module Accounts, but I don't know where modify the query!!!! :-(
    Help me, please!

    Thanks a lot!

  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: Custom field on a subpanel

    Have a look on this thread.

    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
    arasdeveloper2 is offline Senior Member
    Join Date
    Jan 2009
    Posts
    33

    Question Re: Custom field on a subpanel

    Thank a lot for the help, but i've changed the where clausule in Calls/subpanels/ForActivities.php, but of course it doesn't work, besause the INNER JOIN calls_cstm is missing.
    What should I do, to make it work?

    SugarCRM CE

    Thanks.

  4. #4
    A.Duviol is offline Junior Member
    Join Date
    Aug 2008
    Posts
    3

    Default Re: Custom field on a subpanel

    i have the same problem with a custom field in tasks (the dropdown action_c) for opportunities module, and by the way i deleted all other activities which are useless for us.

    After two searching days i hope someone could help me to sort this out.

    The custom field title appears in the lists (in Activities and Opportunities) but none of the values want to show

    here is what i have done :

    custom/modules/Opportunities/Ext/Layoutdefs/layoutdefs.ext.php
    Code:
    $layout_defs["Opportunities"]["subpanel_setup"]["activities"] = array (
        'order' => 20,
        'sort_order' => 'desc',
        'sort_by' => 'date_start',
        'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
        'type' => 'collection',
        'subpanel_name' => 'activities',   //this values is not associated with a physical file.
        'module'=>'Activities',
        
        'top_buttons' => array(
            array('widget_class' => 'SubPanelTopCreateTaskButton'),
    /*      array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
            array('widget_class' => 'SubPanelTopScheduleCallButton'),
            array('widget_class' => 'SubPanelTopComposeEmailButton'),
    */
        ),
    
        'collection_list' => array(    
            'tasks' => array(
                'module' => 'Tasks',
                'subpanel_name' => 'ForOpportunities',
                'get_subpanel_data' => 'tasks',
            ),
        )
    );

    custom/modules/Tasks/metadata/subpanels/ForOpportunities.php
    Code:
    $subpanel_layout = array (
    'where' => "",    
    'list_fields' => array( 
    		'action_c'=>array(
    			 'vname' => 'LBL_LIST_ACTIONS',
    			 'widget_class' => 'SubPanelDetailViewLink',
    			 'width' => '30%',
    		),
    		'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%',
    		),
    		'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'
    		),
    		'assigned_user_name' => array (
    			'name' => 'assigned_user_name',
    			'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
    		),
    		'time_due'=>array(
    			'usage'=>'query_only',
    			 'alias' => 'time_start'	
    		),
    )
    );

    custom/modules/Tasks/metadata/listviewdefs.php
    Code:
    $listViewDefs = array (
      'Tasks' => 
      array (
        'ACTION_C' => 
        array (
          'width' => '10',
          'label' => 'LBL_ACTION',
          'sortable' => false,
          'default' => true,
          'required' => '0',
          'source' => 'custom_fields',
          'name' => 'action_c',
          'id' => 'Tasksaction_c',
          'custom_module' => 'Tasks',
        ),
        'PARENT_NAME' => 
        array (
          'width' => '20',
          'label' => 'LBL_LIST_RELATED_TO',
          'dynamic_module' => 'PARENT_TYPE',
          'id' => 'PARENT_ID',
          'link' => true,
          'default' => true,
          'sortable' => false,
          'ACLTag' => 'PARENT',
          'related_fields' => 
          array (
            0 => 'parent_id',
            1 => 'parent_type',
          ),
        ),
        'DATE_DUE' => 
        array (
          'width' => '15',
          'label' => 'LBL_LIST_DUE_DATE',
          'link' => false,
          'default' => true,
        ),
        'STATUS' => 
        array (
          'width' => '10',
          'label' => 'LBL_LIST_STATUS',
          'link' => false,
          'default' => true,
        ),
        'ASSIGNED_USER_NAME' => 
        array (
          'width' => '2',
          'label' => 'LBL_LIST_ASSIGNED_TO_NAME',
          'default' => true,
        ),
      ),
    );

    module/Activities/metadata/subpaneldefs.php
    Code:
    $layout_defs['Activities'] = array( // the key to the layout_defs must be the name of the module dir
    	'default_subpanel_define' => array(
    		'subpanel_title' => 'LBL_DEFAULT_SUBPANEL_TITLE',
    		'top_buttons' => array(
    			array('widget_class' => 'SubPanelTopCreateTaskButton'),
    /*			array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
    			array('widget_class' => 'SubPanelTopScheduleCallButton'),
    			array('widget_class' => 'SubPanelTopComposeEmailButton'),
    */
    		),
    		'list_fields' => array(
    			'Tasks' => array(
    				'columns' => array(
    					array(
    			 		 	'name' => 'nothing',
    						'widget_class' => 'SubPanelCloseButton',
    			 		 	'module' => 'Tasks',
    			 		 	'vname' => 'LBL_LIST_CLOSE',
    			 		 	'width' => '6%',
    					),
    					array(
    			 		 	'name' => 'action_c',
    			 		 	'vname' => 'LBL_ACTIONS',
    						'widget_class' => 'SubPanelDetailViewLink',
    			 		 	'width' => '30%',
    					),
    					array(
    			 		 	'name' => 'status',
    						'widget_class' => 'SubPanelActivitiesStatusField',
    			 		 	'vname' => 'LBL_LIST_STATUS',
    			 		 	'width' => '15%',
    					),
    					array(
    			 		 	'name' => 'parent_name',
    			 		 	'module' => 'Tasks',
    			 		 	'vname' => 'LBL_LIST_RELATED_TO',
    			 		 	'width' => '22%',
    					),
    					array(
    			 		 	'name' => 'date_start',
    			 		 	//'db_alias_to' => 'the_date',
    			 		 	'vname' => 'LBL_LIST_DUE_DATE',
    			 		 	'width' => '10%',
    					),
    
    				),
    				'where' => "(tasks.status='Not Started' OR tasks.status='In Progress' OR tasks.status='Pending Input')",
    				'order_by' => 'tasks.date_start',
    			),
    		),
    	),
    );
    I may have changed some other files (i really tried everything i found on this forum and over the net)

    Thanks.
    Last edited by A.Duviol; 2009-05-18 at 02:44 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add custom field in activities subpanel of lead
    By vishwasrao in forum Developer Help
    Replies: 4
    Last Post: 2010-05-25, 06:47 PM
  2. Custom field in listview and subpanel
    By SanderMarechal in forum Developer Help
    Replies: 0
    Last Post: 2008-10-17, 02:03 PM
  3. Add Custom Field to QuickCreate Subpanel
    By Meex in forum Developer Help
    Replies: 1
    Last Post: 2007-11-06, 09:56 AM
  4. how to add a custom link to a subpanel field
    By tooth_decay in forum Developer Help
    Replies: 3
    Last Post: 2005-12-06, 09:00 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
  •