This entry is part of the Conditional Expressions HowTo.
A very typical customization task is to make readonly some records of a specific table based on the value of an attribute.
For example you may wish prevent the editing of purchase orders that have a total costs higher than 1000$ for a specific group. Here is a small tutorial about how you can achieve this.
Open Administration – Conditional Expression Manager application and create the following conditional expression:
- Condition: POCOST
- Description: Total cost is more than 1000
- Type: EXPRESSION
- Expression: totalcost>1000
Now go to the Security – Security Groups application. Choose the desired group and open the Data Restrictions tab.
Create the following Object Restriction:
- Object: PO
- Type: READONLY
- Reevaluate: true
- Condition: POCOST
If you now logon with a user belonging to the chosen group and open the Purchase Orders application you will see that POs with a total cost of more than 1000 cannot be modified.
4 thoughts on “How to make record readonly based on an attribute’s value”
Bruno, can you think of a way to make all fields on a PM read only while still allowing the User to Generate Work Order (without customization)? My issue is that Maximo tries to write back to the object and errors because of my 'read only' data restriction.
when a record i made readonly when completed and when i go back to another sttaus it is not allowing as it is alredy readonly
Is it possible to use a conditional expression where the dataset contains nulls to create a data restriction? I'm trying to contrain edit of woactivity rows in an application where woactivity.owner != :user. However, the woactivity.owner values may be other users or null.
creating conditional expression of owner = :user and applying to a READONLY data restriction DOES make the owner's rows READONLY and leaves the others editable, but that is the opposite of what I'm trying to do! 🙂
Trying "owner is null" or "owner <> :user" does not cause any effect in the woactivity rows' editability.
I tried making a record read only based on the status value, but I receive this message when trying to set the status to one of the read-only statuses: “BMXAA6002E – You cannot save object COMPANIES : Organization=PSP Company=2000018 because of the data security restrictions. If you save the object, it becomes retad-only and hidden from you.” My condition is: status not in ‘APPR’. Object is COMPANIES, Type is READONLY, and Condition is :compstatus not in (‘NEW’,’PNDREV’). Any ideas of why I’m receiving the error when saving with one of the READONLY conditions?