- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 07:29 AM
I need to manipulate two date fields for the following action:
Allow date filling from 1 month before the date of the request.
Example: opening in March, you can fill in the date from February onwards.
The two fields are within an MRVS and
the current reference date will be the current system date.
I would like a suggestion on how to carry out this action.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 07:32 AM
Try UI policy with relative operator. with before / After and ago and from now. @Moacir Junior
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
03-01-2024 07:39 AM
You will need to let the user select what they want , and then validate and clear the value if it doesnt meet the criteria
Solved: selected date should not be greater than 30days - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 07:47 AM
You can simply create a UI policy for the date variable in MRVS as like below.
1. Your date of request will be same date on which the record or request is being submited.
2. so do like below:
UI Poilcy condtion > 'State date' is relative 30 days before 'created on'
UI Policy action > Clear field value 'start date'.
Add a message g_addFieldMessage('start_date', error, 'your message '); // 'please select the date in past 30 days...'
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 07:47 AM
You can simply create a UI policy for the date variable in MRVS as like below.
1. Your date of request will be same date on which the record or request is being submited.
2. so do like below:
UI Poilcy condtion > 'State date' is relative 30 days before 'created on'
UI Policy action > Clear field value 'start date'.
Add a message g_addFieldMessage('start_date', error, 'your message '); // 'please select the date in past 30 days...'
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 09:28 AM
Thanks for your help, it worked perfectly for what I needed.