I see from the docs Form Scripts that there are 2 options to conditionally set df property of enable/read-only, show/hide, and mandatory:
First with:
if condition {
frm.set_df_property()
}
and second with:
frm.toggle_enable()
frm.toggle_display()
frm.toggle_reqd()
Now…
- what is the differences of using the
set_df_property
and thetoggle_
code? - The docs said
set_df_property
will refresh the field. Does it mean we have to usefrm.refresh()
for thetoggle_
? - What is the behaviour of toggle? What is it toggled from?
- How does the relation between the
toggle_
and the same settings in the doctype field setup?
Thank you and sorry for the long list of questions.