Smart action field not in readOnly anymore after change hook

Hi Forest,

I have some fields in readOnly . They do appear in readOnly when I open the form.

… however they are not anymore in readOnly once their value is changed by the change hook:

I would like them to stay in readOnly after their value changes.

What I do in the change hook is something like that:

fields["Montant déjà remboursé sur l'échéance"].value = 100

I fixed the issue by resetting the isReadOnly to true just before returning the field:

change:  {
   fields["Montant déjà remboursé sur l'échéance"].value = 100
   fields["Montant déjà remboursé sur l'échéance"].isReadOnly = true
   return fields

is it the right way to do ?

Hey @Guiguijo,

This is indeed a bug on our end. I’m opening a ticket in our issue tracker.

As a not-so-good workaround, the only thing I can propose is to re-override isReadOnly inside your change hooks if that’s blocking on your end.

Be sure you’ll be ping once this is fixed :raised_hands:

1 Like

Yes it’s what I did.


Hi @Guiguijo :wave: sorry for the late response.

The fix has been released now.
Can you confirm your issue is solved ?

Thank you for your patience.

1 Like

Hi @Arnaud_Moncel , I test that and I tell you