- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 03:46 AM
Hi,
Can someone kindly help me to achieve the following:
I have a Cat Item and there is a variable Model Category (A Reference looking at cmdb_model_category)
Also within the Cat Item I have a variable set which includes a Variable (Referencing change_request > Category field)
What I am looking for is if you select in the Model Category field Windows Server then the Category field within the Variable set will set to Server
So I have tried the following:
Catalog UI Policy
When to Run = Model Category CONTAINS Server
Script (Execute if true)
g_form.setValue('category', Server);
Also tried
g_form.setValue('category', 'Server');
This does not work. Is it because the script cannot recognise category within the variable set?
Any assistance would most appreciated.
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 04:56 AM
Hi Daniel,
Why not do this scripting in client script instead of ui policy.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 04:25 AM
Hi DAniel ,
PLease send the entire script .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 04:30 AM
So,
UI Policy is created on the Cat Item:
When to Run = Model Category CONTAINS Server
Script
Execute if true:
function onCondition() {
g_form.setValue('category', Server);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 04:56 AM
Hi Daniel,
Why not do this scripting in client script instead of ui policy.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 03:06 AM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader