Possible bug with sc_field_readonly on onLoadRecord

Hello,

I have a master / detail form.
The detail form is of editable grid view type.
I have configured a checkbox field to make readonly another field, but not works, all records are readonly.
I use this code in the onLoadRecord event:

if ({chPvp} == 1) {
    sc_field_readonly ({pvp}, off);
    }
else {
    sc_field_readonly ({pvp}, on);
} 

This code used on ajax event works perfectly.

I am doing something wrong?

Is the value {chPvp} static or does is it different for each record in onLoadRecord

chPvp is one field from the table and contains 0 or 1

It should be ok, but it sound like SC is applying the readonly to the column, not the field

Does the value of {chPvp} off the last line is the one that SC use to test