Ui policy is not working

chandan31
Tera Contributor

Hi All,

 

I have created Ui policy in that future date should not allow , when i checked 31-7-2024 it is not allowing but when i selected 31-10-2024 it is allowing i do not future date only present date and past date should select .

 

chandan31_0-1722329287697.png

 

chandan31_1-1722329313804.png

 

2 ACCEPTED SOLUTIONS

Satishkumar B
Giga Sage
Giga Sage

Hi @chandan31 
I checked your scenario in my PDI it is working. please remove the alert message if any and try to put the after condition for you "work_start" field.

 

…………………………………………........................................................................................
Mark it helpful 👍and Accept Solution !! If this helps you to understand.

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

 

View solution in original post

Robbie
Kilo Patron
Kilo Patron

Hi @chandan31,

 

Change the logic slightly. You're triggering the code when something is not true and then executing on reverse. Simply execute on true as below.

I've tested and confirmed this using the 'resolved_at' field on the incident form. Simply follow the below and update the field name in your script to 'work_start'.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.



Thanks, Robbie

 

Screenshot 2024-07-30 at 10.38.59.pngScreenshot 2024-07-30 at 10.39.07.png

View solution in original post

6 REPLIES 6

sunil maddheshi
Tera Guru

@chandan31 

Check the below link and configure same

https://www.servicenow.com/community/developer-forum/start-date-cannot-be-in-future-client-script/m-... 

 

Thanks 

Sunil

Please mark correct/helpful, if it helps you in anyway

Robbie
Kilo Patron
Kilo Patron

Hi @chandan31,

 

Change the logic slightly. You're triggering the code when something is not true and then executing on reverse. Simply execute on true as below.

I've tested and confirmed this using the 'resolved_at' field on the incident form. Simply follow the below and update the field name in your script to 'work_start'.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.



Thanks, Robbie

 

Screenshot 2024-07-30 at 10.38.59.pngScreenshot 2024-07-30 at 10.39.07.png