Hello, please advise me how to use a script to check the length of the entered string before saving the record, or not to save the record if the item has less than 10 characters. This check only needs to be done if another entry takes a certain value and the checked entry is less than 10 characters. I have a record that I pre-populate with the same 5 characters for the user at the beginning, because they are always the same. I want the user to fill in the remaining characters of this string. If he doesn’t fill them in, I want to warn him.
I wanted to do this check in the Pre-Save section of the script below:
if (doo.model.typePOS.value === ‘Existing POS’ && doo.model.cisloPOS.value.length < 10) { doo.alert.showError(‘POS item number is not filled in correctly!’,‘POS number should have 10 digits total.’); }; }.
The check passes, the message is displayed, but I don’t know how to ensure that the record cannot be saved until the user enters the checked item correctly.
Thank you. Milan