From 3749017d8085b499054e3f44662272bd710343a4 Mon Sep 17 00:00:00 2001 From: Neha Fathima Date: Wed, 15 Apr 2026 12:09:17 +0530 Subject: [PATCH] fix: mobile number validation the customer doctype --- rmax_custom/public/js/create_customer.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rmax_custom/public/js/create_customer.js b/rmax_custom/public/js/create_customer.js index b270f60..7ab0ff0 100644 --- a/rmax_custom/public/js/create_customer.js +++ b/rmax_custom/public/js/create_customer.js @@ -125,14 +125,12 @@ function open_create_customer_dialog(frm) { ], primary_action_label: "Create Customer", primary_action(values) { - function count_digits(val) { - if (!val) return 0; - return val.replace(/\D/g, "").length; - } - if (count_digits(values.mobile_no) < 10) { + const digits = (values.mobile_no || "").replace(/\D/g, "").length; + if (digits < 10) { frappe.throw("Mobile number must have at least 10 digits."); - } - frappe.call({ + return; + } + return frappe.call({ method: "rmax_custom.api.customer.create_customer_with_address", args: { customer_name: values.customer_name,