- 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-31-2024 08:35 AM
Hi @Hitoshi Ozawa
Yeah I was thinking about using the "Variable Validation Regex" but since I don't have a catalog item for the vendor contact table, the agents are creating the vendor contacts directly on the table through workspace.
Best regards,
charri04

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2024 11:39 PM
@charri04 BTW, it's not possible with UI Policy.
It's possible to create a UI Policy that will convert the value to all CAPS but if the user changes the value, UI Policy will not run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2024 04:27 AM
Yes, you can do this with a scripted UI Policy, but it doesn't work as well as the Business Rule or onChange Client Script as a lowercase value could still be entered on the form by the user, then if the form is updated, not saved, the lowercase will remain until the next time the form/record is loaded.
- 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.