Skip to content

Instantly share code, notes, and snippets.

@rmehta
Created September 24, 2012 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmehta/3774236 to your computer and use it in GitHub Desktop.
Save rmehta/3774236 to your computer and use it in GitHub Desktop.
Sample Custom Script for Validation
// this function is called by erpnext
// in the browser before saving
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment