- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 02:48 PM
Hello developers,
I have a field on the Vendor Contact table that is a string field. I need to ensure that any data that is entered into that field is in ALL CAPS.
Is there an easy way to accomplish this?
Best regards,
charri04
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 03:32 PM
You can do this with a before Update Business Rule on the Vendor Contact table with the Filter Condition <<field_name>> changes:
(function executeRule(current, previous /*null when async*/) {
current.u_string_limit = current.field_name.toUpperCase();
})(current, previous);
Or you could also use an onChange Client Script when this field changes to see the change on the form before the record is submitted/saved:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var upper = newValue.toUpperCase();
if (newValue !== upper) {
g_form.setValue('field_name', upper);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 08:55 PM
@charri04 Should use Business Rule to ensure it. Client Script will only check when the value is entered from the form. If there was a script include or REST API to enter the record, Client Script won't run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 04:46 AM
Hi, Can you check below client script to achieve your expectation.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '')
return;
var str = newValue.toUpperCase();
if (str != newValue)
g_form.setValue("short_description", str);
}
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 03:32 PM
You can do this with a before Update Business Rule on the Vendor Contact table with the Filter Condition <<field_name>> changes:
(function executeRule(current, previous /*null when async*/) {
current.u_string_limit = current.field_name.toUpperCase();
})(current, previous);
Or you could also use an onChange Client Script when this field changes to see the change on the form before the record is submitted/saved:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var upper = newValue.toUpperCase();
if (newValue !== upper) {
g_form.setValue('field_name', upper);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 07:40 PM
Hi @Brad Bowman
Thanks for the reply!
Would it also be possible to use a UI policy?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 08:55 PM
@charri04 Should use Business Rule to ensure it. Client Script will only check when the value is entered from the form. If there was a script include or REST API to enter the record, Client Script won't run.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 09:06 PM
@charri04 If you don't want to script and if it's alright to just check entry from the form, you can defined a regular expression.
- Go to "Service Catalog" > "Catalog Variables" > "Variable Validation Regex"
. Enter Regular Expression as "^[A-Z]+$" is the field only allows characters. If digits are allowed, enter "^[A-Z0-9]+$" - In the field definition, select "Type Specifications" tab and select the regular expression name you've defined in the "Validation Regex".
Execution result: