- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 07:07 AM
Hi Team,
How to select only year from date field.
please any one help on this.
Regards,
Pushpa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 07:52 AM
Hi,
for that you can use onLoad client script with GlideAjax
1) script include will check which is the current quarter and based on that hide the other quarter
Sample script to determine the quarter in server side
var test = new GlideDateTime();
var month = test.getMonth();
var quarter = Math.ceil(month/3);
gs.info('Current quarter is->'+quarter);
Output:
[0:00:00.069] Script completed in scope global: script
Script execution history and recovery available here
*** Script: Current quarter is->2
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 10:41 PM
Hi Ankur,
Please share in details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 11:00 PM
Hi,
the main part on how to check the quarter is shared above.
You need to perform onLoad Client script with GlideAjax
in client script based on quarter value you need to hide the values
if(quarter == 1){
// do nothing
}
if(quarter == 2){
// hide choice value for Q1
}
if(quarter == 3){
// hide choice value for Q1,Q2
}
if(quarter == 4){
// hide choice value for Q1,Q2,Q3
}
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2021 08:05 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
