web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Dynamic Dropdown of Year Dates?

(0) ShareShare
ReportReport
Posted on by 5

As the title says I'm looking to implement a dropdown of years(eg. 2020,2021,2022)  the requirement needs only the current, previous, and next year to be available.  My first thought was implementing a PCF dropdown that could dynamically update every year.  I'm wondering if anyone has any other ways to implement this that I'm missing.

I have the same question (0)
  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Dynamic Dropdown of Year Dates?

    Hi,

    As far as I know, there is no control in Dynamics 365 that can be used for this purpose. PCF control seems to be a fair idea.

    However another approach is to use a lookup:

    • Create a custom entity 'Years'.
    • Create following records:
      • Label: 2020
      • Value: -1 (for previous Years)
      • Label: 2021
      • Value: 0 (current year)
      • Label: 2022
      • Value: 1 (next year)
    • Add this lookup to your entity.

    The drawback for this approach is to you have to update the labels every year.

    You can also create an Entity to load All years (starting form 2019). Then create a view to only list data for Prev. Current and Next Year (using date filters and OR operator).

    Finally, you can also create an optionset, add all year and filter the values onload of the form (using JavaScript).

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Dynamic Dropdown of Year Dates?

    Hi, 

    I think you will be able to use a PCF Control.

    There is a control that applies to the DATE-ONLY field, it's a simple Year picker:
    https://github.com/delegateas/PCF

    You can also implement your own PCF control that supports text and number fields.

  • Suggested answer
    MehranBre Profile Picture
    732 on at
    RE: Dynamic Dropdown of Year Dates?

    hi willnmzo,

    you can create a option set with three options names: "Last Year", "This Year", "Next Year" with values

    1, 2, 3

    and when you are use this data compare this with record createdon date for get a valid selected year.

    it seems very simple for you (in control and collect data) and also for your clients!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 76 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

#3
Anthony Blake Profile Picture

Anthony Blake 43 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans