During the development of the Creatio custom functions, you may need to lock all fields and details on an edit page under certain conditions. The mechanism of locking edit page fields lets you implement page business logic without creating additional business rules.
As a result of applying the locking mechanism on an edit page, all fields and details will become locked. If the field has a binding for the enabled property in the diff array element or the business rule, the mechanism will not lock this field. Locking a detail will hide buttons and menu items for performing operations with the detail records. A locked detail with an editable list will still feature an ability to access the object page, however, all fields on it will be locked.
To enable the locking mechanism, set the source code of the edit page to false for the IsModelItemsEnabled model attribute:
Alternatively, set the default value for the attribute:
Additionally, to operate the locking mechanism on a specific edit page in the diff array of this page, specify the DisableControlsGenerator generator for the containers in which you want to lock fields. Therefore, to lock all fields of an edit page, specify the global CardContentWrapper container:
To fix the error:
- Find out the name of the group containing all employees. To do this, use the following DB query.
- Run the script provided below on your database. Note that the @allEmpoyeeGroupName field must be filled in with the name of the group containing all employees of your organization.
The script introduces an extra feature into the system, PageDesignerCustomGeneratorFix, and enables it for the “All employees” user group.
-
Examine the generateCustomItem() method in the ViewModelSchemaDesignerViewGenerator module. The method must look like this:
-
On the newly added FeaturesPage, check the value of the PageDesignerCustomGeneratorFix setting. When the mouse pointer hovers on
, a notification The feature has enabled state for the group of the users must pop up.
Locking exceptions
It is possible to disable locking for some fields and details. To do this, override the getDisableExclusionsDetailSchemaNames() and getDisableExclusionsColumnTags() methods. These methods return lists of fields and details that should not be blocked by the mechanism. The implementation of methods is available below:
More complex exception logic can be implemented by overriding the isModelItemEnabled() method for fields and the isDetailEnabled() method for details. These methods are called for each field and detail. They receive the name and return the availability signal of the field or detail. The implementation of methods is available below: