Variable mandatory On Saving form in SCTASK

Sylvain12
Tera Contributor

Hi Everyone,

 

I am trying to set a variable mandatory in a SCTASK of a catalog item.

 

The condition is the SCTASK state.

 

It works fine if task state is closed complete, the task cannot get closed if the variable is not filled.

 

However I have to set the variable mandatory if task state is: Pending.

I used a UI Policy with setMandatory in the script.

The variable becomes mandatory in the form, but it is still possible to save it without populating the variable.

Basically the red star (for mandatory) is showing up when I select "Pending", but it disappears when I save the form.

 

Anyone might have an idea on how to fix this ?

 

Thank you very much in advance for your kind support.

 

Kr,

Sylvain

6 REPLIES 6

Mayur2109
Kilo Sage
Kilo Sage

Hi @Sylvain12 ,

I see no issues here please refer screenshots attached.

Screenshot 2024-10-16 at 3.56.12 PM.pngScreenshot 2024-10-16 at 3.56.30 PM.pngScreenshot 2024-10-16 at 3.56.41 PM.pngScreenshot 2024-10-16 at 3.56.54 PM.png

 

If you are still facing issues please share screenshot of UI policy if possible.

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul

ServiceNow Rising Star 2024

Hello @Mayur2109,

 

Please find the screenshot below:

Sylvain12_0-1729074297706.png

 

Thank you

Hello @Mayur2109 

Thank you very much for your prompt reply.

On your screenshot n°2, did you try to click on "Update" ? For me it is updating without alerting about the mandatory variable

Hi @Sylvain12 ,

Yes it's showing me same error message for update as well.

 

Regards,

Mayur Shardul