Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to create catalog item specific states on SCTASK form

Not applicable

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

4 REPLIES 4

Not applicable

@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.

…………………………………………........................................................................................

Not applicable

Hello @Community Alums ,

 

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

Not applicable

@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.

…………………………………………........................................................................................

WayneH490346913
Tera Contributor

Hi @Community Alums 

I have this same requirement. I'm not seeing that the solution suggested by @Community Alums worked for you, did you try it or find another solution? Thank you.