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

Thread: New field in popup window

  1. #1
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default New field in popup window

    Hi.
    I have SugarCRM 5.0.0e in Windows XP.

    I created a new module with the subpanel 'Accounts'. In this subpanel, when I do select, I want the popup window appears the field 'Type' (account_type).
    As I do this?
    I tried to change the file <root>/ modules/Accounts/metadata/popupdefs.php: (changes are in bold)
    Code:
    global $mod_strings;
    
    $popupMeta = array('moduleMain' => 'Account',
    	'varName' => 'ACCOUNT',
    	'orderBy' => 'name',
    	'whereClauses' => 
    	array('name' => 'accounts.name', 
    	'billing_address_city' => 'accounts.billing_address_city',
    	'phone_office' => 'accounts.phone_office'),
            'account_type' => 'accounts.account_type'),
    'searchInputs' =>
    	array('name', 'billing_address_city', 'phone_office', 'account_type'),
    	'create' =>
    	array('formBase' => 'AccountFormBase.php',
    	'formBaseClass' => 'AccountFormBase',
    	'getFormBodyParams' => array('','','AccountSave'),
    	'createButton' => $mod_strings['LNK_NEW_ACCOUNT']
    		  ),
    'listviewdefs' => array(
    	'NAME' => array(
    	width' => '40', 
    	'label' => 'LBL_LIST_ACCOUNT_NAME', 
    	'link' => true,	
    	'default' => true,								        
    	 ), 
    	'BILLING_ADDRESS_STREET' => array(
    	'width' => '10', 
    	'label' => 'LBL_BILLING_ADDRESS_STREET',
    	'default' => false,										        
    	),
    	'BILLING_ADDRESS_CITY' => array(
    	'width' => '10', 
    	'label' => 'LBL_LIST_CITY',
    	'default' => true,										        
    	),
    	'BILLING_ADDRESS_STATE' => array(
    	'width' => '7', 
    	'label' => 'LBL_STATE',
    	'default' => true,									        	
    	),
    	'BILLING_ADDRESS_POSTALCODE' => array(
    	'width' => '10', 
    	'label' => 'LBL_BILLING_ADDRESS_POSTALCODE',
    	'default' => false,										        
    	),
    	'BILLING_ADDRESS_COUNTRY' => array(
    	'width' => '10', 
    	'label' => 'LBL_COUNTRY',
    	'default' => true,
    	 ),
    	'PHONE_OFFICE' => array(
    	'width' => '10', 
    	'label' => 'LBL_LIST_PHONE',
    	'default' => false),			
    	 ),						     
    	'ASSIGNED_USER_NAME' => array(
    	'width' => '2', 
    	'label' => 'LBL_LIST_ASSIGNED_USER',
            'default' => true,
    	 ),
            'ACCOUNT_TYPE' => array(
    	'width' => '10', 
    	'label' => 'LBL_TYPE',
    	'default' => true,
            ),
    ),
    'searchdefs'   => array(
    'name', 
    'billing_address_city', 
    'billing_address_state',
    'billing_address_country',
    ]'account_type',
    array('name' => 'assigned_user_id', 'label'=>'LBL_ASSIGNED_TO', 'type' => 'enum', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
    										  )
    						);
    These changes will add the column 'Type' in the 'Account List'.
    the next link shows what I do: http://www.dibconsulting.com/sites/images/image2.jpg
    What should I do? Someone can help me?
    Thank you
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: New field in popup window

    I think you must edit the popup_picker.html to add this field.

  3. #3
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default Re: New field in popup window

    Thanks Kuske.

    I'll try to do the file popup_picker.html.
    You can give me an example how I do to file popup_picker.html for the 'account_type'?

    Thenks
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

  4. #4
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: New field in popup window

    I just did this yesterday.

    Are you trying to add a search field or list field?

    To add a search field add this code under the advanced search array in modules/module_name/metadata/searchdefs.php.

    Code:
    10 => 
    array (
         'name' => 'field_name',
         'label' => 'LBL_FIELD_NAME',
         'type' => 'field_type',
    ),
    Note: replace the number (10) with the next unused number. It's okay to skip numbers but you can't have any numbers without an entry or you will get a white screen on the popup.

    Likewise to remove a field comment out or remove an entry including the number.

    The list fields should be the same as you setup the listview layout in studio.

    Hope this helps!

  5. #5
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default Re: New field in popup window

    Thanks bstonehill...

    I had succeeded! After I repair with admin user in SugarCRM and now exists in the field popup.

    Thanks
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

  6. #6
    xamremy is offline Junior Member
    Join Date
    Jun 2008
    Posts
    3

    Default Re: New field in popup window

    Hi guys,

    I'd like to do the same thing as fbrites.
    The solution from bstonehill doesn't seem to be working.
    fbrites, could send the code from your popupdefs.php after repair please ? or explain more clearly what you have done ?
    Thanks for helping.

  7. #7
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default Re: New field in popup window

    Hello xamremy

    In my case it worked. I created the 'account_type' in the popup window.

    This is my file 'popupdefs.php' with changes (<root>/ modules/Accounts/metadata/popupdefs.ph)

    PHP Code:
    global $mod_strings;

    $popupMeta = array('moduleMain' => 'Account',
                            
    'varName' => 'ACCOUNT',
                            
    'orderBy' => 'name',
                            
    'whereClauses' => 
                                array(
    'name' => 'accounts.name'
                                        
    'billing_address_city' => 'accounts.billing_address_city',
                                        
    'phone_office' => 'accounts.phone_office',
                                        
    'account_type' => 'accounts.account_type'),
                            
    'searchInputs' =>
                                array(
    'name''billing_address_city''phone_office''account_type'),
                            
    'create' =>
                                array(
    'formBase' => 'AccountFormBase.php',
                                        
    'formBaseClass' => 'AccountFormBase',
                                        
    'getFormBodyParams' => array('','','AccountSave'),
                                        
    'createButton' => $mod_strings['LNK_NEW_ACCOUNT']
                                      ),
                            
    'listviewdefs' => array(
                                                
    'NAME' => array(
                                                    
    'width' => '40'
                                                    
    'label' => 'LBL_LIST_ACCOUNT_NAME'
                                                    
    'link' => true,    
                                                    
    'default' => true,                                        
                                                    ), 
                                                
    'BILLING_ADDRESS_STREET' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_BILLING_ADDRESS_STREET',
                                                    
    'default' => false,                                                
                                                    ),
                                                
    'BILLING_ADDRESS_CITY' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_LIST_CITY',
                                                    
    'default' => true,                                                
                                                    ),
                                                
    'BILLING_ADDRESS_STATE' => array(
                                                    
    'width' => '7'
                                                    
    'label' => 'LBL_STATE',
                                                    
    'default' => true,                                                
                                                    ),
                                                
    'BILLING_ADDRESS_POSTALCODE' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_BILLING_ADDRESS_POSTALCODE',
                                                    
    'default' => false,                                                
                                                    ),
                                                
    'BILLING_ADDRESS_COUNTRY' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_COUNTRY',
                                                    
    'default' => true,
                                                    ),
                                                
    'ACCOUNT_TYPE' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_TYPE',
                                                    
    'default' => true,
                                                    ),
                                                 
    'PHONE_OFFICE' => array(
                                                    
    'width' => '10'
                                                    
    'label' => 'LBL_LIST_PHONE',
                                                    
    'default' => false),                                         
                                                
    'ASSIGNED_USER_NAME' => array(
                                                    
    'width' => '2'
                                                    
    'label' => 'LBL_LIST_ASSIGNED_USER',
                                                    
    'default' => true,
                                                   ),
                                                ),
                            
    'searchdefs'   => array(
                                                 
    'name'
                                                
    'billing_address_city',
                                                
    'billing_address_state',
                                                
    'billing_address_country',
                                                array(
    'name' => 'assigned_user_id''label'=>'LBL_ASSIGNED_TO''type' => 'enum''function' => array('name' => 'get_user_array''params' => array(false))),
                                                
    'account_type',
                                              )
                            );
    ?> 

    After go to admin -> repair -> quick repair -> module 'accounts'

    This image of the popup window: http://www.dibconsulting.com/sites/i...opup_final.jpg

    Hasta
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

  8. #8
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default Re: New field in popup window

    xamremy done well?
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

  9. #9
    xamremy is offline Junior Member
    Join Date
    Jun 2008
    Posts
    3

    Default Re: New field in popup window

    it worked fine for me.

    Thanks !

  10. #10
    fbrites is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Lisbon, Portugal
    Posts
    77

    Default Re: New field in popup window

    Good.

    More some help says.

    Hasta

    Fábio
    Fábio Brites
    <Sugar 6.>
    <Windows XP>

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. Howto get Contact PopUp Field
    By Nico.awc in forum Developer Help
    Replies: 5
    Last Post: 2011-09-27, 08:49 PM
  2. Replies: 10
    Last Post: 2011-01-09, 02:37 AM
  3. "Select All" in Selection Popup Window
    By kenshiro in forum Developer Help
    Replies: 12
    Last Post: 2010-05-25, 11:54 AM
  4. Field in popup window
    By fbrites in forum Developer Help
    Replies: 0
    Last Post: 2008-05-27, 03:47 PM
  5. custom field and popup
    By guvencacarkan in forum Developer Help
    Replies: 0
    Last Post: 2007-07-27, 03:19 AM

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
  •