- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 10:56 PM
Hi All,
I need to remove values from two reference fields, one choice field and one List Collector field based on a choice field selection.
Type of Request : Choice List ( On selection of this field, the below field values needs to be cleared )
Knowledge Base : Reference
Categories : Reference
Role: Choice
Manage Acess: List Collector
I tried using 'OnChange' Catalog Client Script but it isn't working:::
function onChange(control, oldValue, newValue, isLoading) {
// if (isLoading || newValue == '') {
// return;
// }
//Type appropriate comment here, and begin script below
if (isLoading) {
return;
}
if (newValue == "") {
g_form.clearValue('knowledge_base_kb');
g_form.clearValue('categories_kb');
g_form.clearValue('role_kb');
g_form.clearValue('manage_acess_kb');
}
}
Can someone help me in this?
Regards,
Saurabh Chatterjee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 11:15 PM
Can you check if Ui type is selected ALL & Variable name
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 11:29 PM
Hi @Vishal Birajdar ,
Yes I had to select 'All' and it worked.
Thank you for your help as well
Regards,
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 11:39 PM
selecting All should have been the 1st thing when you create the client script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 11:43 PM
Indeed..!! I have also done same mistakes in initial phase.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 09:41 AM