Customer would like a choice (i.e., drop down) field that they can select a Year (i.e., YYYY)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 03:33 PM
A customer has a current requirement where they would like a drop down (i.e., choice) field to present current and past years for a user to make a selection.
- I have reviewed the Docs, Community, and YouTube, but have not seen a solution surface.
- Has anyone successfully configured something like this?
- I'm attaching a generic example of the requirement.
Thanks in advance for any support! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 03:35 PM
Here's the image that I attached previously. -- Thanks again! 🙂
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 09:38 PM
For this field, configure the choices dynamically using a script. You can use a Server Script or a Business Rule script to generate the list of years. Here's an example of how you can achieve this using a Server Script:
var yearChoices = [];
var currentYear = new Date().getFullYear();
var earliestYear = currentYear - 10; // You can adjust this range as needed
for (var year = currentYear; year >= earliestYear; year--) {
yearChoices.push(year.toString());
}
// Set the choices on the field
current.u_review_year.setChoiceList(yearChoices.join(','));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 03:54 PM - edited ‎08-18-2023 03:55 PM
Hello Jeff,
It looks like "Review Year" is defined as a choice field in the system dictionary. And accessing that dictionary record you should see a "Choices" tab on the form. You can add choices there. Maybe you want to dynamically create the choices based the current year. But that is not clear from your post.