Add a year in field of type enumeration

0
I am making a field called Year. It is of type enumeration as I want to add it in a drop down menu. The first enumeration I added is 2018 which is going to be the first  value and the next value I want to add is 2019 which is the current year how do I do this using a microflow. What iā€™m trying to do here is that the drop down menu should start from 2018 then 2019 but it should add 2019 using current year. I do not want the full date and time just the year ā€œ2019ā€. So when the next year comes it gives the option of three years which is 2018, 2019 and 2020 which is another thing I was considering to do. But for now i want it to display 2019 and is there a way to display 2018 as well without having to use enumeration? I want this to be done using a drop down menu only.
asked
2 answers
2

I wouldn’t recommend hard coding in some enumerations for year selection. As you stated it should only ever show the current year and the next. Therefore every year you would have to change these manually and redeploy. 

You could setup a scheduled event to change two records of an entity YEAR every year or setup a page in admin to do this.

If you only want to show the year you can use formatDateTime($DateAttribute,’YYYY’)

 

answered
2

A better option to show years without enumeration is to create an entity ‘Year’ with and attribute ‘Year’.  Create the objects using a Microflow or just create a grid and mannualy create the years that you need.

Associate your object with the Year entity and now you can use the reference selector drop-down.

answered