Good Day,
I am trying to update the from_date and to_date field in the salary structure form using a custom script. What I am trying to do boils down to this:
frappe.ui.form.on("Salary Structure Earning", "modified_value", function(frm, cdt, cdn) {
frm.doc.from_date = '2014-7-1';
}
However this doesn’t seem to work. Any ideas?
Hi shantanubhadoria,
Considering you want to set from_date and to_date fields on salary structure on form loads, you have to do some modifications in your script.
Currently you are accessing child table ie “Salary Structure Earning” instead access Salary Structure
Put trigger on onload event instead of modified_value
also check for __islocal to set values only to non saved form.
rmehta
July 10, 2015, 7:03am
#3
Use frm.set_value("from_date", "2014-07-01")
1 Like
Thanks, That was what I was looking for.