We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Date Field On change CS

servicenow14710
Tera Expert

Hello developers,

 

I need to implement a scenario where user has to select a date range which is dependent on custom field from custom table(lets say it has values 1, 2, 3 etc. so on). If user selects 1 then Date field on UI has to enable to select one month back from today.

If user selects 2 then date field should enable to select two months back from today.

 

Please suggest the logic, Any suggestion is appreciated,

Thanks!

USER DATE 

1 REPLY 1

vermaamit16
Kilo Patron

Hi @servicenow14710 

 

You should give it a try with the UI Policies instead of Client Script. Refer below posts and give it a try :

https://www.servicenow.com/community/virtual-agent-forum/how-to-restrict-the-date-variable-in-a-cata...

https://www.servicenow.com/community/developer-forum/restrict-user-to-select-past-date-in-catalog-it...

 

Thanks and Regards

Amit Verma

Thanks and Regards
Amit Verma