- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:45 PM
HI Community,
I have a requirement, in catalog form we have a variable called software (reference to software install table) and price variable (single line). in software install table there is field called Licence Type
When user selects any software in software variable and its licence type is licensed then show the price variable in form if not do not show this.
Please provide me the catalog client script and script include.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 01:07 AM
you cannot do this with UI policy.
You will have to use onChange client script with getReference callback and check the type and then show/hide the other variable
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var ref = g_form.getReference('softwareVariable', callBackMethod); // software variable name
}
function callBackMethod(ref) {
// compare correct field name and choice value for licensed
if (ref.licenseTypeField == 'licensed')
g_form.setDisplay('otherVariable', true); // give other variable name here
else
g_form.setDisplay('otherVariable', false); // give other variable name here
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 03:28 AM
it must be because of some other client script or UI policy.
Did you debug that?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 02:36 AM
Thank you for marking my response as helpful.
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