- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 10:20 AM
How do I show the state choice "closed skipped" on sc_task table ONLY for one catalog item in particular called "hardware request" and hide all the others ? I don't want other catalog items to have this state choice.
I have tried UI policy with a condition "item is "hardware" but I am struggling with script. Any help with script or any other way to achieve this?
Any help will be appreciated, thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 06:54 AM
This is a tried and tested solution in my PDI and it works for me perfectly fine... check my attached solution which I have tested in my PDI. Might be you are missing something. Make sure that what is the backend value of "close skipped" in your instance.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 10:31 AM - edited 02-21-2023 11:07 AM
You can use onLoad client script, which will check if the Item field is your "hardware" one.
IF it is add option else remove it.
g_form.addOption('state', 'Close-Skipped', 'Close-Skipped', 7);
example for not found
g_form.removeOption('state', 7);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 10:44 AM
@cicgordy ,
Please write a on load script on the "sc_task" table as mentioned below:
function onLoad() {
g_form.getReference('request_item',Myfunc);
function Myfunc(response){
if((response.cat_item).getDisplayValue() != "hardware request"){
g_form.removeOption('state',7);
}
}
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:56 AM
Hi @Prince Arora,
how can I also make it appear ONLY in one catalog task of that catalog items called "hardware approval"? I would like the close skipped state to appear only when the "hardware approval" task creates. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 04:06 AM
Please confirm what is the "hardware approval", is it a name of catalog item?
It would be great if you share the screenshot as an example to resolve your query quickly.
What is the hardware approval? (name of the catalog item or short description of the catalog task?)
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.