sc_btn_display does not work on detail grid inside a form

Hi All…

I have a form, which has 3 detail grids, each one with it’s own “insert” (new) button.

Under certain conditions, The main form is “read only”, so I wanted to turn off the insert button on the form, and on all of the child grids.

Inside the main form, I check for conditions, and set a global variable to control this functionality.
I read that variable in OnScriptInit of each grid (only place where sc_btn_display is allowed in grids), but it does not work.

If I test the functionality just by running these child grids and setting the global variable manually, it works perfectly, so I’m assuming that the root cause is the grid being a detail on the form.

As a test, I tried just placing simple code like the following, and although it works when executing the grid by itself, it fails again when it is a detail grid in a form.

sc_btn_display ('new', 'off');

For the time being, my only workaround has been to edit the child form called by these grids, checking for that same global variable, and if the conditions are met, just exiting the form, hence returning to the previous main form with the detail grid… but it’s far from a polished approach I guess…

can anyone else reproduce this? is it by design for some reason I don’t understand?

Have a good day everyone.