How to create catalog item specific states on SCTASK form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 01:06 PM
Hello There,
Greetings!!!
We have a requirement to create or add some states on SCTASK form for specific catalog items. Your help is highly appreciated.
Thanks,
Tejas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 01:33 PM
@Community Alums To manage custom states on the SCTASK form for specific catalog items, define the states, use Client Script/UI Policy for visibility and functionality.
…………………………………………........................................................................................
Please Mark it helpful 👍and Accept Solution ✅!! If this helps you to understand.
…………………………………………........................................................................................

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 01:38 PM
Hello @Satishkumar B ,
Thank you for your reply. I am aware that we need to achieve that using client script/ui policy, I tried addoption or removeoption methods but it's not working, do you have any working script or solution.
Thanks,
Tejas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 02:14 PM
@Community Alums try this , it worked for me:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var catalogItemStates = {
'implementation': ['1', '2'],
'testing': ['3', '4']
};
// Get the current change task type (newValue)
var catalogItem = newValue;
// Get the states for the current change task type
var validStates = catalogItemStates[catalogItem] || [];
// Clear existing state options
g_form.clearOptions('state');
// Add valid state options
validStates.forEach(function(state) {
g_form.addOption('state', state, state);
});
}
…………………………………………........................................................................................
Please Mark it helpful 👍and Accept Solution ✅!! If this helps you to understand.
…………………………………………........................................................................................
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 08:43 AM
Hi @Community Alums
I have this same requirement. I'm not seeing that the solution suggested by @Satishkumar B worked for you, did you try it or find another solution? Thank you.