November 30, 2018
By Vince McGowan, Senior Principal Software Engineer
With Hot Fix 34 (10.2.1.0.351) two new personalization features have been implemented for standard Lawson forms: the ability to move existing fields and the option to display hidden fields. As with all personalization features, the User’s role contains settings to determine if they are available. Much like scripting, these two are considered advanced features and thus disabled in the default.xml role.
Once the user is granted access, two new items appear on the Tools => Personalizations menu.
- Move Fields
- Display Hidden Fields
The ability to move fields has always been available, but until this feature was implemented it required script to do so. With this option now available, you can decide whether to change that script to a personalization or leave it as is. If it is detected that fields have been moved in script (using MoveElement or MoveDetailElement), those fields will not be available as a personalization.
When the Move Fields item is selected, the dialog below is presented. The dialog will consist of one or more tabs, depending on the form definition. The Form tab will always appear and show the fields of the definition which are not part of a detail area. And if defined, there is a tab for each detail area. Each tab will have 2 lists: the available fields and the fields selected to be moved. The 2 lists can be sorted alphabetically or appear in the order loaded by the form. The example below is for AP20.1, the Basic Invoice screen with the Form tab activated.
When an available field is selected and added to the Moved Fields (it’s also possible to drag an available field to the moved list), a properties dialog is presented where you specify the new position of the field. The example below is for a form field and which can be placed on the Form or any of the form-level tab pages which are defined. Specify a row and column, though typically the size will not change. There is also an option to specify a label, which eliminates the need to use script to create a new label.
Once all the values are entered, use of the Preview button allows you to refine the position if not exactly where you wanted it. In the example below, prior to moving the fields, other personalizations were performed to hide existing fields and labels.
Once all the moved fields have been defined for the current form view be sure to click the Save button in the main dialog window and the personalizations will be applied.
The ability to move a field via personalization also exists on the field context menu (Right-click or Shift+F10).
Some restrictions apply to the ability to move fields:
- Line FC or SC and Label fields cannot be moved.
- Fields moved in script may not be moved via personalization.
- Fields moved via personalization can only be moved again by using the Moved Fields dialog. (Context menu item will be disabled.)
- A moved field cannot be hidden via Unconditional Hide Field. (Context menu item will be disabled and field will not display a Checkbox in full form hide fields mode.)
- A label is not allowed for fields moved to a detail line.
Display Hidden Fields
A common customization request was to be able to ‘move fields’ from a sub-form to the main form. In that scenario, the reality is the field is already defined on the form but hidden from display. Then when the sub-form is accessed and data entered, the values are returned to the main form hidden fields. So how this has been handled in Smart Office was again to write script around it. However, the scripting required to support this is much more complex than the MoveElement function call and involves hooking up events, minimally Before/After Transaction, and possibly more. The new Display Hidden Fields personalization solves all of that.
The process to display a hidden field is very similar to moving a field – the personalization dialog even looks the same, with a Form tab and a tab for each detail area.
For an example of this I will use the Purchase Order Worksheet (PO23.1) application. The requirement is to display the major and minor purchasing classes normally captured on the line detail sub-form (PO23.3) in the main form detail area. On the detail area tab of the Displayed Hidden Fields dialog I added those two fields to the Displayed Hidden Fields list.
Then I set the field properties in the Hidden Field properties dialog. Note there are additional field properties as compared to the Moved Fields properties. These additional properties are enabled/disabled based on the field properties defined on the form which can be viewed on the Xml attributes tab.
Notice also the different positioning choices: to display in the detail area row or, if available, on one of the detail line tabs. In this case I chose the line Purchasing tab. When I preview the field, I see the image below.
Some restrictions also apply to the ability to display hidden fields:
- Hidden FC or SC and ‘Position To’ fields cannot be displayed.
- Display Hidden Fields displayed via personalization can only be moved by using the Displayed Hidden Fields dialog. (Context menu item will be disabled.)
- A Displayed Hidden cannot be hidden via Unconditional Hide Field. (Context menu item will be disabled and field will not display a Checkbox in full form hide fields mode.)
- A label is not allowed for a hidden field displayed on a detail line.
When considering using either of these personalizations:
- Determine who should have this functionality and set the appropriate roles to allow access.
- Apply other personalizations, including script, before moving fields or displaying hidden fields.
- Get rough estimate on a field position by examining field info of a nearby field. Field info now shows row, column, and column span for its the screen element. (Row is a 0-based value relative to the parent object.)
- Whether moving fields in script or via personalization, there is a slight performance hit, especially for those forms with lots of fields in that the entire form must be rendered. The same is true for displaying hidden fields.
- If moving fields or displaying hidden fields via personalization, all field tab stops will be reset, so it would not be necessary to do so in script since script executes before the fields are moved or displayed.