The following table highlights the layouts available for the Employees and Users modules.
|User Holidays Subpanel||x|
|OAUTH Access Tokens Subpanel||x|
Both modules basically share the same layout options with the exception of the additional two subpanels for the Users module. The User Holidays Subpanel and OAuth Access Token Subpanel layouts appear on the Users module’s DetailView.
The studio layout management for the Users module is similar to that of other modules. You may rearrange fields, add rows, remove rows, etc. The Display panels as tabs checkbox option only affects the layout of the User Profile tab for the Users module. The Users layout screens that you may modify via Studio will always be contained inside a set of system level tabs such as the Advanced, Access and Downloads tabs. These system level tabs vary depending on the type of user record viewed as well as the user’s permissions.
The studio layout management for the Employees module is more simple. By default there is only one panel for the DetailView and EditView layouts. Unlike the Users module there is no enforced system level tabs so the Display panels as tabs checkbox option will allow you to create tab layouts for all panels.
Because the Users and Employees modules share the same database table, adding custom fields to Users will result in the field appearing in Employees and vice versa. The users_cstm table stores the database value and database attributes of the field only. Other field attributes such as whether or not the field uses a formula, a dependency on another field, is importable, etc. are contained in the module’s variable definition. This information is stored in files in the custom directory as well as in the fields_meta_data database table. The end result is that adding a custom field to the Users will make the custom field available to the Employees module and vice versa. However, the layout placement and the display label of the custom field will not be carried over and these are the caveats to be aware of. This is so because the language and layout files for the Users and Employees modules reside in different directories. By enabling studio support for the Users and Employees module, we wanted to give the administrator the option to decide which fields are pertinent to a particular layout and how to label such fields accordingly. In the event that a display label key was already used by the complementary module, we also did not want to override the label value. So you will see that adding a custom field with a label in the Users module will also add the custom field to the available list of fields in the Employees module, but that the display label value will default to the label key used in creating the field for the Users module. You may look at the fields_meta_data table to see which are the common values shared across both modules.
The following table highlights the custom field properties and whether creating a custom field in either module will have the resulting property copied over to the complementary module.
|Data Type||Yes||type column in fields_meta_data|
|Field Name||Yes||name column in fields_meta_data|
|Display Label||No||Resides in individual language files|
|System Label||Yes||vname column in fields_meta_data table|
|Help Text||Yes||help column in fields_meta_data table|
|Comment Text||Yes||comments column in fields_meta_data table|
|Default Value||Yes||default_value column in fields_meta_data table|
|Max Size||Yes||len column in fields_meta_data table|
|Calculated Value||Yes||In Extensions/modules/Users/Ext/Vardefs/sugarfield_[name]_c.php and modules/Users/Ext/Vardefs/vardefs.ext.php|
|Dependent||Yes||In Extensions/modules/Users/Ext/Vardefs/sugarfield_[name]_c.php and modules/Users/Ext/Vardefs/vardefs.ext.php|
|Required Field||Yes||required column in fields_meta_data table|
|Audit||Yes||audited column in fields_meta_data table|
|Importable||Yes||importable column in fields_meta_data|
|Duplicate Merge||Yes||duplicate_merge column in fields_meta_data|
A note on upgrades. In 6.4, we will move the following Users files into the custom/backup directory upon upgrade:
In summary, the 6.4 release has exposed the Users and Employees modules through studio. This was a requested feature from many of our customers. Because of the dynamic nature of many of the fields in these two modules, the metadata files contain a lot more customizations. We will dive into this in a future article, but for now, we hope that enabling the administrator to add some custom fields and configure layouts through studio for the Users and Employees greatly empowers your business!