- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2016 08:35 AM
I need to make a simple client script that will hide "Messaging" as choice from the Category field when the INC Number does not contain VRT. When it does contain VRT, I want the "Messaging" choice to appear.
I have this as a start, but this would only work if the new value equaled "VRT." As these are INC Numbers, they will always be changing... INC0001 - VRT, INC0002, INC0003 - VRT, etc...
function onChange(control, oldValue, newValue) {
if (newValue == 'VRT') {
g_form.addOption('category', 'Messaging');
else {
g_form.removeOption('category', 'Messaging');
}
thanks,
Richelle
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2016 08:57 AM
Richelle,
You can write an onLoad client script and add these lines inside the onLoad function
if (g_form.getValue('number').toString().indexOf('VRT')>-1) {
g_form.addOption('category', 'Messaging');
else {
g_form.removeOption('category', 'Messaging');
}
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2016 08:57 AM
Richelle,
You can write an onLoad client script and add these lines inside the onLoad function
if (g_form.getValue('number').toString().indexOf('VRT')>-1) {
g_form.addOption('category', 'Messaging');
else {
g_form.removeOption('category', 'Messaging');
}
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2016 09:08 AM
That worked perfectly! Thank you so much. I'll add that to my list of useful scripts.
Richelle