- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 05:34 AM
I am trying to add validation on my record producer. If a field's value is more than 6 characters, excluding symbols, show error message. I was able to accomplish this with the form that the service desk uses but not the end user side. Below is the code that I found online, can someone please assist?
if (newValue.length > 6) {
g_form.setValue('u_account_number', 0);
g_form.showFieldMsg('u_account_number', 'You may not enter a more than 6 characters', 'error');
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 06:01 AM
Try
if (newValue.length > 6) {
g_form.clearValue('u_account_number');
g_form.showFieldMsg('u_account_number', 'You may not enter a more than 6 characters', 'error');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 06:01 AM
Try
if (newValue.length > 6) {
g_form.clearValue('u_account_number');
g_form.showFieldMsg('u_account_number', 'You may not enter a more than 6 characters', 'error');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 06:02 AM
Hi,
So what did you do for the form that works for fulfillers? What you pasted above?
Do you have this placed in an onChange client script and then have you chosen that variable as the field in which to enact itself upon?
Please share the full script from that onChange client script and include a screenshot as well of the whole thing if you can.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 06:14 AM
I just tried you code in my persona dev instance after I created this field and a record producer. It seems to work fine for me. I notice that you mentioned 6 char excluding symbols but just checking the length of a string would include all chars. Is there more to you script that you are not sharing?