- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 10:58 AM - edited 05-07-2025 10:59 AM
Hi There,
I have one requirement on Client Script,
I have one 'u_tower' (choice type) field, and which is having 4 choices,
1.Controlling
2.Financing
3.Account payable
4.General Accounting
and my requirement is, when the country is Portugal and the Tower is GA at that time the below case_category values shouldn't visible to the user to select
1. urgent payments
2. General Ledger Accounting.
I have written the below code but which is not working for me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 12:00 PM
Hi @Priya madyapgol ,
Try this :
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var towerValue = g_form.getValue('u_tower');
var countryValue = g_form.getValue('u_country'); // Assuming that country field is named 'u_country' on ur isntance
if (towerValue == 'General Accounting' && countryValue == 'Portugal') {
g_form.removeOption('u_case_category', 'urgent payments');
g_form.removeOption('u_case_category', 'General Ledger Accounting');
}
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 12:00 PM
Hi @Priya madyapgol ,
Try this :
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var towerValue = g_form.getValue('u_tower');
var countryValue = g_form.getValue('u_country'); // Assuming that country field is named 'u_country' on ur isntance
if (towerValue == 'General Accounting' && countryValue == 'Portugal') {
g_form.removeOption('u_case_category', 'urgent payments');
g_form.removeOption('u_case_category', 'General Ledger Accounting');
}
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 12:26 PM
Hi @Sohail Khilji ,
I tried the above code which you have mentioned, but still it is not working for me, the values are still visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 01:08 AM
Please recheck the values which are passed in parameters it must work.
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 01:57 AM
Share few things first
1) share the choice list screenshot for u_tower
2) share from where are you picking language? is it coming from some field or you are saying logged in user's language
3) are you removing the correct choice value from that field u_case_category?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader