List View columns not visible on specific roles/users

Hello,
I created a custom package, but I have a really weird problem.
I’m using SuiteCrm 7.9.12.

The “List View” hides some columns when used by Admin or Role “A”, it shows all columns when used by Role “B”.

It seems that the displayColumns variable has a different number of items based on the Role/User that is using the list view.

I added some debug information in the \themes\SuiteP\include\ListView\ListViewGeneric.tpl file and this is the situation:

Display Columns for Admin/Role A:


Array ( [width] => 78 [label] => LBL_NAME [default] => 1 [link] => 1 [type] => name [name] => name [vname] => LBL_NAME [dbType] => varchar [len] => 255 [unified_search] => [full_text_search] => Array ( [boost] => 3 ) [required] => [importable] => required [duplicate_merge] => disabled [merge_filter] => disabled [inline_edit] => 1 [duplicate_merge_dom_value] => 0 ) 1
Array ( [width] => 21 [label] => LBL_ASSIGNED_TO_NAME [module] => Employees [id] => ASSIGNED_USER_ID [default] => 1 [type] => relate [name] => assigned_user_name [link] => assigned_user_link [vname] => LBL_ASSIGNED_TO [rname] => user_name [reportable] => [source] => non-db [table] => users [id_name] => assigned_user_id [duplicate_merge] => disabled [massupdate] => ) 1

Display Columns for Admin/Role B:


Array ( [width] => 9 [label] => LBL_ASSIGNED_TO_NAME [module] => Employees [id] => ASSIGNED_USER_ID [default] => 1 [type] => relate [name] => assigned_user_name [link] => assigned_user_link [vname] => LBL_ASSIGNED_TO [rname] => user_name [reportable] => [source] => non-db [table] => users [id_name] => assigned_user_id [duplicate_merge] => disabled [massupdate] => ) 1
Array ( [width] => 35 [label] => LBL_NAME [default] => 1 [link] => 1 [type] => name [name] => name [vname] => LBL_NAME [dbType] => varchar [len] => 255 [unified_search] => [full_text_search] => Array ( [boost] => 3 ) [required] => [importable] => required [duplicate_merge] => disabled [merge_filter] => disabled [inline_edit] => 1 [duplicate_merge_dom_value] => 0 ) 1
Array ( [type] => varchar [default] => 1 [label] => LBL_CLIENTE_NOME [width] => 10 [inline_edit] => 1 [labelValue] => cliente nome [required] => [source] => custom_fields [name] => cliente_nome_c [vname] => LBL_CLIENTE_NOME [massupdate] => 0 [no_default] => [comments] => [help] => [importable] => true [duplicate_merge] => disabled [duplicate_merge_dom_value] => 0 [audited] => [reportable] => 1 [unified_search] => [merge_filter] => disabled [len] => 255 [size] => 20 [id] => SINIS_Segnalazionecliente_nome_c [custom_module] => SINIS_Segnalazione ) 1
Array ( [type] => varchar [default] => 1 [label] => LBL_CLIENTE_COGNOME [width] => 10 [inline_edit] => 1 [labelValue] => cliente cognome [required] => [source] => custom_fields [name] => cliente_cognome_c [vname] => LBL_CLIENTE_COGNOME [massupdate] => 0 [no_default] => [comments] => [help] => [importable] => true [duplicate_merge] => disabled [duplicate_merge_dom_value] => 0 [audited] => [reportable] => 1 [unified_search] => [merge_filter] => disabled [len] => 255 [size] => 20 [id] => SINIS_Segnalazionecliente_cognome_c [custom_module] => SINIS_Segnalazione ) 1
Array ( [type] => varchar [default] => 1 [label] => LBL_ CLIENTE_TARGA [width] => 10 [inline_edit] => 1 [labelValue] => cliente targa [required] => [source] => custom_fields [name] => cliente_targa_c [vname] => LBL_ CLIENTE_TARGA [massupdate] => 0 [no_default] => [comments] => [help] => [importable] => true [duplicate_merge] => disabled [duplicate_merge_dom_value] => 0 [audited] => [reportable] => 1 [unified_search] => [merge_filter] => disabled [len] => 255 [size] => 20 [id] => SINIS_Segnalazionecliente_targa_c [custom_module] => SINIS_Segnalazione ) 1
Array ( [type] => relate [link] => 1 [label] => LBL_MODIFIED_NAME [id] => MODIFIED_USER_ID [width] => 10 [default] => 1 [module] => Users [name] => modified_by_name [vname] => LBL_MODIFIED [reportable] => [source] => non-db [rname] => user_name [table] => users [id_name] => modified_user_id [duplicate_merge] => disabled [massupdate] => [inline_edit] => ) 1
Array ( [type] => datetime [label] => LBL_DATE_ENTERED [width] => 10 [default] => 1 [options] => date_range_search_dom [name] => date_entered [vname] => LBL_DATE_ENTERED [group] => created_by_name [comment] => Date record created [enable_range_search] => 1 [inline_edit] => ) 1

You can see that the number of available colums is really different.

What can I do in order to have the same number of columns in the List View for all the users ?

By ListView you mean the columns that provide fields of the record?

By default there isn’t any listview restriction even for Admin/Role. I can only think that would be down to customisation. You say you’ve created a custom package… you need to be more specific to what this custom package does. We can only assist with as much info as possible.
Is this a fresh instance or a customised one i.e. Security Suite installed etc.

Thank you for your answer.
The custom package is a custom object with some fields and no custom logic.
By List View I mean the visualization of the list, defined by Administration -> Studio -> (my package) -> Layouts -> “List View”.

The problem is that the admin doesn’t see all columns in the List view.

Here are the logs when the call is done by admin:



Tue Apr 10 09:21:07 2018 [4328][1][DEBUG] Limit Query: SELECT  sinis_segnalazione.id , sinis_segnalazione.assigned_user_id , sinis_segnalazione.name , sinis_segnalazione.created_by  FROM sinis_segnalazione  LEFT JOIN sinis_segnalazione_cstm ON sinis_segnalazione.id = sinis_segnalazione_cstm.id_c  where sinis_segnalazione.deleted=0 ORDER BY sinis_segnalazione.name ASC Start: 0 count: 21


and the log when the call is done by normal user, this shows all the fields:




Tue Apr 10 09:20:39 2018 [4328][963659f0-1748-b0c4-6596-5a7cd3ab9d7b][DEBUG] Limit Query: SELECT  sinis_segnalazione.id ,sinis_segnalazione_cstm.cliente_cognome_c,sinis_segnalazione_cstm.cliente_nome_c,sinis_segnalazione_cstm.cliente_targa_c, sinis_segnalazione.assigned_user_id , sinis_segnalazione.modified_user_id , sinis_segnalazione.name , sinis_segnalazione.date_entered , sinis_segnalazione.created_by  FROM sinis_segnalazione  LEFT JOIN sinis_segnalazione_cstm ON sinis_segnalazione.id = sinis_segnalazione_cstm.id_c  where ( ( sinis_segnalazione.assigned_user_id ='963659f0-1748-b0c4-6596-5a7cd3ab9d7b'  or  EXISTS (SELECT  1
                  FROM    securitygroups secg
                          INNER JOIN securitygroups_users secu
                            ON secg.id = secu.securitygroup_id
                               AND secu.deleted = 0
                               AND secu.user_id = '963659f0-1748-b0c4-6596-5a7cd3ab9d7b'
                          INNER JOIN securitygroups_records secr
                            ON secg.id = secr.securitygroup_id
                               AND secr.deleted = 0
                               AND secr.module = 'SINIS_Segnalazione'
                       WHERE   secr.record_id = sinis_segnalazione.id
                               AND secg.deleted = 0) ) ) AND sinis_segnalazione.deleted=0 ORDER BY sinis_segnalazione.date_entered DESC Start: 0 count: 21


Tell me if you need details on specific files.

Ahh, right!

As a user you can choose what columns are available per list view.

Navigate to the list view in question as an admin and click on ‘Column Chooser’ which is located next to the Filter button. Are the columns in their correct ‘destination’ of ‘Displayed’ and ‘Hidden’?

1 Like

I feel really dumb.
I lost 4 hours thinking it was a problem related to my custom package, or related to permission and roles… and I didn’t ever noticed the icon “Column Chooser”…

Thank you very much!

May I suggest, on the admin view, to add a warning "some columns are hidden, click “Column Chooser” to configure ?

It should be use a cookie in order to show itself once x List View, but it could save some other poor fellow like me :slight_smile:

Thanks again!