Hi community
i would like to know if possible instead of getting Today date value as default value get Yesterday i tried
frappe.datetime.add_days(Today, -1) not working
any help
regards
Hi community
i would like to know if possible instead of getting Today date value as default value get Yesterday i tried
frappe.datetime.add_days(Today, -1) not working
any help
regards
I think, you can get the date from yesterday with this inline script.
frappe.datetime.add_days(frappe.datetime.nowdate(), -1);
I tried the same think in default field but not working for me eather custom script worked
Hello, @SOLOSOFT!
Can you please give us the code to your custom script so that we can help you debug the script? Aside from that, can you check if your browser’s console is showing an error and post the traceback here? Thanks!
cur_frm.cscript.custom_title = function(doc, cdt, cd){
cur_frm.set_value(“title”, frappe.datetime.add_days(frappe.datetime.nowdate(), -1));
cur_frm.set_value(“date”, frappe.datetime.add_days(frappe.datetime.nowdate(), -1));
}
@solosoft, i think you might need to add the following :
cur_frm.refresh_field("date")
cur_frm.refresh_field("title")
OR
cur_frm.refresh()
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.