Conditional Fields to make "Read-only"

Hello,

It would be very useful if fields could be turned “read-only” if conditions are met on other fields in the same table, the same way now fields can be hidden, shown, make required and make optional.

I need fields that can be edited to became read-only when the process changes hands. User 1 cannot edit fields that were previously editable just by a change in the process stage.

In my case, I need a budget to be created by an user but does not allow the same user to change it after approval. This assures me that the budget is not changed after it is approved. Approval is a change in stage of the process when a specific user click on an “Approve” button, part of the same table.

The solution I found was to create a separate table just for approved budgets and an automation that creates a record in this table every time a budged is approved in the original budget table. The approved budget table is read only for the users who create the budgets. In practice it worked, but I’m not happy with the solution as I lost the possibility to use the kanban functionality as now I have to work with two budget tables. In addition, if a process has more stages, I would need more tables to make it work.

Thanks!

Hey @Fernando_L

Thanks for your suggestion! A workaround you can use is to create a low code permission. Something like when a record changes to status X, the user who has a profile Y cannot edit it

Hello @marcos.figueiredo,

As you suggested in another post, I used the Jestor.error to deal with this situation.

The code is very simple, when the “fase” field is set as “Aprovado”, the trigger is activated and Jestor.error is called. See below:

if($objectOld[“fase”] == “Aprovado”){
Jestor.error(“Não é possível alterar orçamentos aprovados”);
}

It worked fine, but something is bothering me and maybe there is a way around it. When I try to change a field from a record that is “Aprovado”, the error message comes only after the field is changed and the field stays with the new value. To the user who tried to change the field, it looks like the change happened. Only after and if the page is reloaded, the field reverts back to its original value, but not before reloading the page.

I know the Jestor.error worked, but I’m sure it will be confusing to other users not familiar to how it works.

Any way around this? Ideally, the field should revert back right after the record is changed, signaling to the user that the change was not carried through.

Thanks again!

Hi @Fernando_L

The field will be reversed because it is updated via websocket, just take a few seconds, but if you refresh the page will be updated instantly