How can I lock the whole page (make it read only) based on record conditions on Freedom UI 8.1?

Hello,



For a new app on version 8.1, I'm trying to lock up all fields on a page based on the record condition. I have a Locked by field on the record and if the field is empty or different than the current user, I want to make the whole page read only. 



I was able to do that on previous versions by adding some code to the page. At high level I needed to add the  IsModelItemsEnabled attribute and have a "setCardLockoutStatus" method that triggers when the UsrLockedBy field changes. I also need to do a merge operation on the CardContentWrapper to set the generator value to DisableControlsGenerator.generatePartial.



What page code I need to write to accomplish something similar on 8.1? Or can that be accomplished now with no code?



Thanks,

Jose

Like 4

Like

4 comments
Best reply

Hello Jose,

 

The way of locking the whole page you've described is based on using the "CompleteCardLockout" feature. Unfortunately, it is not available to use on the Freedom UI pages. 

However, you may implement it using Page Designer business rules. It is possible to specify a rule that makes all the input fields editable/read-only based on the field value condition, for example:

 

The same approach might be implemented via code using the “readonly” attribute. Here is the example: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/platform-customization/freedom-ui/customize-page-fields/examples/set-up-the-condition-that-locks-the-field#title-3819-2. You may create one common attribute that will be responsible for locking the fields, though in that case, you should manually add its name to the "readonly" value of every field.

 

Also, you may consider using record permissions instead of the "Locked by" field. This type of permission is based on the record authorship, here are the details: https://academy.creatio.com/docs/8.x/setup-and-administration/administration/user-and-access-management/access-management/record-permissions.

 

Best regards,

Natalia

Hello Jose,

 

The way of locking the whole page you've described is based on using the "CompleteCardLockout" feature. Unfortunately, it is not available to use on the Freedom UI pages. 

However, you may implement it using Page Designer business rules. It is possible to specify a rule that makes all the input fields editable/read-only based on the field value condition, for example:

 

The same approach might be implemented via code using the “readonly” attribute. Here is the example: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/platform-customization/freedom-ui/customize-page-fields/examples/set-up-the-condition-that-locks-the-field#title-3819-2. You may create one common attribute that will be responsible for locking the fields, though in that case, you should manually add its name to the "readonly" value of every field.

 

Also, you may consider using record permissions instead of the "Locked by" field. This type of permission is based on the record authorship, here are the details: https://academy.creatio.com/docs/8.x/setup-and-administration/administration/user-and-access-management/access-management/record-permissions.

 

Best regards,

Natalia

Natalia Kalynovska,

Thanks Natalia. I do have a lot of fields on the page so I was looking for something like the CompleteCardLockout feature, but business rule will do. Do you know if there are any plans to have that feature on the freedom UI version? It takes some maintenance to keep those rules updated every time fields are added to the page.

Jose Hernandez,

 

We registered such a request for our R&D department, and they will consider implementing this feature for the Freedom UI pages.

Thank you for helping us to make our product better!

Natalia Kalynovska,

This feature would be very useful, definitely miss having that option that we had in Classic UI.

Show all comments