Hello everybody,
How to set a field number phone that dose not register if it doesn't contain at least 14 characters ?
I appreciate any help
Hello everybody,
How to set a field number phone that dose not register if it doesn't contain at least 14 characters ?
I appreciate any help
Hello Phuong Trinh,
You can do it through code.
First, locate the record.js
file for your specific module. You’ll typically find it at the following path:
custom/modules/yourModule/clients/base/views/record/record.js
({ extendsFrom: 'RecordView', initialize: function (options) { this._super('initialize', [options]); this.context.on('button:save_button:click', this._save_desc, this); }, _save_desc: function (model) { let phone = this.model.get('phone_mobile'); // Convert the number to a string let phoneString = phone.toString(); // Get the length of the string let length = phoneString.length; if (length < 14) { app.alert.show('error', { level: 'error', messages: 'The length was less than 14 digits', autoClose: false }); } else { // do something } }, })
From this you can acheive what you want.
Thank you...
Hello Phuong Trinh,
You can do it through code.
First, locate the record.js
file for your specific module. You’ll typically find it at the following path:
custom/modules/yourModule/clients/base/views/record/record.js
({ extendsFrom: 'RecordView', initialize: function (options) { this._super('initialize', [options]); this.context.on('button:save_button:click', this._save_desc, this); }, _save_desc: function (model) { let phone = this.model.get('phone_mobile'); // Convert the number to a string let phoneString = phone.toString(); // Get the length of the string let length = phoneString.length; if (length < 14) { app.alert.show('error', { level: 'error', messages: 'The length was less than 14 digits', autoClose: false }); } else { // do something } }, })
From this you can acheive what you want.
Thank you...