brotherton-erpnext/docs/dev/custom_script_examples/docs.dev.custom_script.validate1.md

12 lines
278 B
Markdown
Raw Normal View History

---
{
"_label": "Restrict Purpose of Stock Entry"
}
---
cur_frm.cscript.custom_validate = function(doc) {
if(user=="user1@example.com" && doc.purpose!="Material Receipt") {
msgprint("You are only allowed Material Receipt");
validated = false;
}
}