Im trying to validate the mobile number field from the lead form in order to create an opportunity. I’ve made a custom script which checks for the mobile number, but I’m getting stuck on the else statement.
Could someone please help me out?
cur_frm.cscript.create_opportunity = function(doc) {
if(cur_frm.doc.mobile_no.length < 10 ){
msgprint("Please Enter a Valid Mobile Number");
}
else{
validated = true;}
}
Won’t frappe.ui.form.on will get triggered in parallel for “create_opportunity” and thus won’t stop a user from creating an opportunity even if the mobile no is invalid?