- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 01:13 AM - edited ā01-15-2024 06:37 AM
I need to create a catalog item with a variable which accepts date. When user requests an catalog item, it should check if the date entered in date variable is it from past. If yes, then it should display one alert message and clear the value from date field and abort the submission.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 01:20 AM
This is not about widget but just a catalog item thing.
You need to create a variable on the catalog item(maintain items -> find your item -> New Variable)
then Add a UI policy that checks if the date ins i9n past and throw error -> EG here No Code date validations through (Catalog) UI Poli... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 02:11 AM
Hi @VikramM1
You can create a Catalog Item
Under that create a Variable of Date Type
In Catalog UI policy
put condition
variable date is before Today
If yes
In script
add alter message and your work done.
Please try the same and share feedback.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 01:20 AM
This is not about widget but just a catalog item thing.
You need to create a variable on the catalog item(maintain items -> find your item -> New Variable)
then Add a UI policy that checks if the date ins i9n past and throw error -> EG here No Code date validations through (Catalog) UI Poli... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 02:29 AM
I Know But, i need to display the field in Service portal widget and keep this validation from Widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-15-2024 02:11 AM
Hi @VikramM1
You can create a Catalog Item
Under that create a Variable of Date Type
In Catalog UI policy
put condition
variable date is before Today
If yes
In script
add alter message and your work done.
Please try the same and share feedback.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************