Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions rmax_custom/public/js/create_customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading