Display 4 columns on accounts

Hello
I have difficulties to understand in the forum topics how to display 4 columns on accounts views. Is it in detailviewdefs.php or in css ?
Can you help me.
Thanks
Olivier

1 Like

*** Disclosure: I’m still using the Suite R Theme, as I like its compactness. It’s very clean. Suite P still needs work…***

  1. The files you need to edit are: editviewdefs.php and detailviewdefs.php.

  2. Important: To make your changes upgrade-safe, copy these two files from the /suitecrm/modules/Accounts/metadata folder into /suitecrm/custom/modules/Accounts/metadata.

  3. Look for this section of code in each file …

‘maxColumns’ => ‘2’,
‘widths’ =>
array (
0 =>
array (
‘label’ => ‘10’,
‘field’ => ‘30’,
),
1 =>
array (
‘label’ => ‘10’,
‘field’ => ‘30’,
),

Change it to:

‘maxColumns’ => ‘4’,
‘widths’ =>
array (
0 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),
1 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),
2 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),
3 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),

  1. After you have made these changes, navigate to Admin>>repair>>Quick Repair and Rebuild
    . (This will quickly “rebuild”/refresh SuiteCRM, to include your code changes).

  2. You will then need to adjust the edit and detail view layouts (Studio>>Accounts>>Layouts >>> EditView and DetailView) to add/arrange the fields correctly on your new 4-column screen layout .

  3. Go to your Accounts detail view page and reload the page to see the changes with your live data.

Notes:

You can play around with the label and field sizes above, to get the desired visual effect.

You may also make these change to other SuiteCRM modules, simply by following the folder structure and looking for the similar section of code.

For ease of use, I always have several SuiteCRM windows open at once, so I can tweak things and quickly see the effect.

HTH,
Paul

Hello Paul
Thanks for your advice.
I don’t understand because I don’t have 4 columns on the Studio>>Accounts>>Layouts >>> EditView and DetailView.
I think that my script written in editviewdefs.php and detailviewdefs.php is not good. It is probably because of the “arrays”. Could you send me an example of editviewdefs.php ?
Thanks in advance
Olivier

When you drag a new row to the layout, do you see 4 boxes?

no. I just have 2 boxes :woohoo:

Can you post the portion of your editviewdefs.php file that has the maxColumns and widths?

Here it is and a screenshot of the studio view. I start becoming creazy !!!
Thanks in advance.

$viewdefs [‘Accounts’] =
array (
‘DetailView’ =>
array (
‘templateMeta’ =>
array (
‘form’ =>
array (
‘buttons’ =>
array (
0 => ‘EDIT’,
1 => ‘DUPLICATE’,
2 => ‘DELETE’,
3 => ‘FIND_DUPLICATES’,
‘AOS_GENLET’ =>
array (
‘customCode’ => ‘’,
),
),
),
‘maxColumns’ => ‘3’,
‘widths’ =>
array (
0 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),
1 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),
2 =>
array (
‘label’ => ‘20’,
‘field’ => ‘30’,
),

	 3 => 
    array (
      'label' => '20',
      'field' => '30',
    ),
	
	
  ),

‘lbl_detailview_panel2’ =>
array (

      0 => 
      array (
        'name' => 'adeccobudget_c',
		'studio' => 'visible',
        'label' => 'LBL_ADECCOBUDGET',
      ),
      1 => 
      array (
        'name' => 'adecco_c',
        'studio' => 'visible',
        'label' => 'LBL_ADECCO',
      ),
     2 => 
      array (
        'name' => 'adeccoreporting_c',
        'studio' => 'visible',
        'label' => 'LBL_ADECCOREPORTING',
      ),
	 3 => 
      array (
        'name' => 'adequat_c',
        'studio' => 'visible',
        'label' => 'LBL_ADEQUAT',
      ),
	
	),

Change the ‘maxColumns’ value to 4 instead of 3. Do a repair and rebuild. Once you do that, add a new row to the layout and you should see 4.

Also, I believe the values in the widths object should add up to 100.

One more thing, I have never been able to get the SuiteP theme to recognize more than 2 columns. I have a layout with 3 columns and it never works in SuiteP.

I have done what you told me. It does not work.
I changed to theme “Suite 7”. It is horrible and it drives me creazy (see pictures enclosed)
Could you please tell me which theme allows 3 columns and send me an example of editviewdefs.php file.
I would be very grateful.
Thanks in advance

I am using the SuiteR theme and my editviewdefs.php file looks like:


'maxColumns' => '3',
      'widths' => 
      array (
        0 => 
        array (
          'label' => '10',
          'field' => '20',
        ),
        1 => 
        array (
          'label' => '10',
          'field' => '20',
        ),
        2 => 
        array (
          'label' => '10',
          'field' => '20',
        ),
      ),

Olivier,

As I mentioned, I’m still using Suite R. SuiteCRM is an awesome product, but it’s very screen hungry … everything is too spaced-out, especially in Suite P. (This may be OK for mobile/pad users, but not good for desktop and laptop users, where any CRM is still mainly used).

Firstly, as McGrath pointed out, you need to change maxColumns to 4, as there are 4 elements to the array below it (0, 1, 2 and 3). Then do a repair/rebuild, to reflect your code changes.

In the Studio layouts, where you place your fields, you won’t actually see four columns, just that the shaded rows (of the field positions) are spaced wider. (It’s somewhat hard to explain). Also, be sure to click on the minus ("-") signs to shorten double-wide fields, to give you space to add fields.

What I also found is that if you have any address or comment field blocks, (i.e. wide fields), if you only put one or two to a line, they will stretch nicely across the screen.

Btw, you can also make your Advanced search screen show the fields 4-across (instead of 3-across), by making this change in the /custom/Accounts/metadata/searchdefs.php file…

$searchdefs [‘Accounts’] =
array (
‘templateMeta’ =>
array (
‘maxColumns’ => ‘4’,
‘maxColumnsBasic’ => ‘4’,
‘widths’ =>
array (
‘label’ => ‘10’,
‘field’ => ‘30’,
),
),

(This change will work in the other modules, too).

p.s. McGrath … not sure about things adding up to 100. The settings I’m using work great on my system … albeit using Suite R theme.

1 Like

Correction! the correct path to searchdefs.php is: /custom/modules/Accounts/metadata/searchdefs.php

Thanks guys for your help. It works well

A last question : when I update an account it works well. When I want to insert info into the customized fields, it does not work.
I think it is not a problem of permissions because I can modify data on standard fields.
Do you have an idea ?
Thanks

That’s great news, Olivier! That screen layout is looking good - it’s nice and compact! (Have you tried four columns across - I’m just curious?)

I’m not sure why you are having a custom field update problem, as the change you made was just to the screen layout. My guess is that this issue is something else.

Did the custom field updates work OK when it was just 2 columns across? (You could quickly change things back to 2-columns, to check).

Addendum to my comments above …

there is no need to change any code back to 2-columns in order to test your custom field updating under the original settings.

Simply rename the /custom/modules/Accounts/metadata/editviewdefs.php file suffix to .phpx and do a repair/rebuild. This will cause SuiteCRM to use its original (2-column) editviewdefs file.

After you are done testing, simply change it back to .php and do a rebuild to reactivate your changes.

Hello
Unfortunately it does not work.
Do you think it is in the syntax of the editviewdefs? See enclosed the file
Thanks for your help

Did you revert back to the original two-column screen format, before re-testing your custom field updating? Please try this, as we need to be sure that there was not already an inherent problem with your custom fields.

I’m using a four-column edit screen (using the Suite R theme) and I have never had any problems.

Hello
Unfortunately it does not work with a two-column screen format.
Strange. An idea ?
Thanks