Date field with only month and year

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 05:32 PM
On the contract table (ast_contract), financials tab provides monthly and yearly value based on start and end date.
user would like to select month and year (example a date field) and see what is the total cost of the contract as of that month and year
Option 1) provide a dropdown with list of choices for month and year. This option is not scalable
Option 2) provide date field with only month and year . Is this possible ?
Option 3) provide date field. User selects dd/mm/yyyy. Parse the month and year from the date selected. Causes confusion to the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 06:42 PM
Hi Nithin,
you can have below approach:
1) choice field with value for months as Jan, Feb, Mar, etc
2) choice field with value for year 2020, 2021
here you will have to run a scheduled job to insert choice value for the year field; this job would require to run start of the year
Or instead of having the above approach best is to have date field; parse it
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
02-14-2023 09:04 PM
Hello @Ankur Bawiskar ,
2) choice field with value for year 2020, 2021
can you please guide on how to create year drop down with only years, e.g., from current year to 2050.
Any suggetsion is highly appreciated.THANKS!