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

278 B

_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;
    }
}