Custom script not working in new version 8.3.X

Hi all,

Here is a script
frappe.ui.form.on(“Sales Invoice”, “validate”, function(frm2) {
if (frm2.doc.posting_date < 31-03-2017) {
msgprint(“You cannot select past date in Sales Invoice”);
validated = false;

it is not working in version 8.3.X, anyone please help me.

Can You please share the traceback or screen-shot of the error with us?

No error in Console, but if i change any value and try to save and submit, first it will save again it is showing save option only not submit button option. It should show submit button instead of save button after saving the document.

Are you sure there were no additions to the script?