error on macro sc_field_display({My_Field}, on/off)

I am trying to use this macro on a form.
OnApplicationInit

if ({owner_trust_indem} == “yes”)
{
sc_field_display({owner_trust_indem_why}, on);
}
else
{
sc_field_display({owner_trust_indem_why}, off);
}

I get the following error :
Fatal error: Call to a member function GetTag() on null in C:\Program Files (x86)\NetMake\v81b\wwwroot\scriptcase\devel\class\generator
mFontePHPForm.class.php on line 13400

Any idea why? Is my syntax wrong? The column names are correct.

I try it on onloadrecord with the same result

Update : I updated my SC and now I’m not getting the error. However, the “hide” is not working…any ideas still appreciated!

Search in forum for gettag, is something related to theme AFAIR

Try to use the macro in the onload.