Advertisement
Guest User

Untitled

a guest
Mar 10th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cur_frm.cscript.custom_validate = function(doc) {
  2.   $.each(wn.model.get("Sales Order Item", {parent:doc.name}), function(i, d) {
  3.     if(d.amount <= 0) {
  4.       var msg = "Please enter a value for X for item " + d.item_code;
  5.       msgprint(msg);
  6.       throw msg;
  7.       // or use wn.throw(msg) to do both msgprint and throw in one go, if it is available in your version
  8.     }
  9.   }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement