- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 01:33 PM
Hi guys, how are you?!
There are 2 Changes: "Emergency" and "Normal"
I need only the NORMAL fields "Category" and "Subcategory" to be populated.
Both are in the Global scope, but I need it to be only for "Normal", so I would like to know if
it is possible to use the sysId of "Normal" (0f3e3f2283d02210062ecb65eeaad3c5)? (img1)
1) I created a template to populate some fields, but this is not a good option for the client (img2)
2) I tried to test using g_form_setValue:
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setValue('assigned_to',g_user.userID);
}
Could someone help me?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 06:37 PM
Hello @eltonasanto
Whenever you select Normal then the Category and Subcategory fields to appear and whenever you select Emergency then these Categories and Subcategory fields remain hidden - To achieve this use UI policy where you don’t need to code.
I would encourage you to create UI policy for change_request table, apply the filter condition and then using it’s related list create UI policy actions.
Share your results here!
All the best and Happy Leanings!
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:33 PM
Hello @eltonasanto
You want to populate category and subcategory only when change is normal and otherwise you want to hide it ? Is this the thing ?
What is the issue you are facing exactly - not able to populate them correctly or not able to hide them correctly ?
Kindly mark my answer as helpful and accept solution if it helped you in anyway,
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNe
EISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 06:37 PM
Hello @eltonasanto
Whenever you select Normal then the Category and Subcategory fields to appear and whenever you select Emergency then these Categories and Subcategory fields remain hidden - To achieve this use UI policy where you don’t need to code.
I would encourage you to create UI policy for change_request table, apply the filter condition and then using it’s related list create UI policy actions.
Share your results here!
All the best and Happy Leanings!
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:31 AM
Hi @Vishal Jaswal, how are you?!
I would like to thank you for your tip (UI Policy instead of Client Script)
I have created it (example):
1) Filter: Model is Normal
2) function onCondition() {
g_form.setValue('category','hardware');
g_form.setValue('business_service', 'SAP Enterprise Services');
g_form.setValue('cmdb_ci','*ANNIE-IBM');
}
function onCondition() {
g_form.clearValue('category');
}
Thanks again!!! 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:33 PM
Hello @eltonasanto
You want to populate category and subcategory only when change is normal and otherwise you want to hide it ? Is this the thing ?
What is the issue you are facing exactly - not able to populate them correctly or not able to hide them correctly ?
Kindly mark my answer as helpful and accept solution if it helped you in anyway,
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNe
EISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:34 AM
Hi @Shivalika , how are you?!
A: You want to populate category and subcategory only when change is normal and otherwise you want to hide it ? Is this the thing ?
Q: Yes! Only when Model is Normal.
I used UI Policy instead of Client Script and it is working.
I would like to thank you for your attention and support.
Best regards 😉
