Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<html><head><title>onEdit example</title><script type="text/javascript"> 
/** disable edit if accounttype = HMO **/
function onEditJSON() {
	return "[{\"action\":\"select\",\"invoke\":\"checkCondition\",\"parameters\":[{\"modulefields\":[{ \"module\":\"1\", \"fields\":\"ACCTKW01\"}],\"filter\":\"1.uid=$1.uid\"}]}]";
} 

function checkCondition(row) {
	var result; 
	result = "true";
	if(row. length>0){ 
		if(row[0]._1.ACCTKW01 == "HMO") {
			window.location = "melt://showAlert/No Edit Allowed"; 
			result = "false";
		}
	}
	return "[ {\"action\":\"validate\",\"result\":\"" + result + "\"} ]";
}
</script></head><body></Body><body></html>