Hello all
1 I’m using a client script to manage the “Display Depends On” aspect of various docfields.
I want to reset the Category docfield, which is of Select field type, to it’s default value when the Attached file is cleared. The default is defined as part of the docfield’s definition.
How can I re-assign this default value, “Not Selected”, when the docfield is no longer hidden, in other words when it is displayed again. Obviously, I can simply assign the literal string, but I’d like to access, and re-assign, it’s default programmatically. Something such as
frm.doc.category.setDefault();
or
frm.doc.category = frm.doc.category.getDefault();
2 Also, how can I access the “Reload File” and “Clear” events?
category: function(frm) {
if (frm.doc.category === "Not Selected") {
frm.set_df_property("attach", "hidden", 1);
frm.set_df_property("upload", "hidden", 1);
} else {
frm.set_df_property("attach", "hidden", 0);
//The following is incorrect, but I need to tie into the "Clear" event or call the method
frm.doc.attach.clear();
}
},
Thanks so much