Mandatory field before submit

Hi! In customizing doctypes, how do you make a field mandatory only before submit? Field should not be mandatory on save, only on submit. Is there a script I can type here in Mandatory Depends On (JS)?

doc.status == 1
?

I’ll try this :smile:

Hi @mehmehly,

Please apply it.

eval:doc.docstatus!=1

Then reload and check it.

Thank You!

2 Likes

Is this viable as well: eval:doc.status == “Submitted”?

I think you can only achieve it via before_submit in a client script,
‘’’
if (!from.doc.field){frappe.throw(“Field is mandatory”)}
‘’’
Setting mandatory depends on for docstatus !=1 will make the field mandatory on save.

The last one worked!