D
|
david22585 3/7/2022 |
The display is only for the display of a field, not what is written to the DB. If you want to write it to the DB, you should use an event. When you do this though, it will have an issue if you have to go back and select a new quarter, as it won't have "Q4 2022" as a selectable option. There are two ways to do this, in the quarter table, insert each selectable option do that it matches if you need to go back and edit data. For example, insert each quarter and year that you want as a selection. If you want to prevent other years, you can add an additional column that has the year, and in the WHERE clause, exclude years such as years that have past. This way the data matches as being selectable to what is selected and stored. The second way is to make it as an before add event as follows: $values["quarter"] = "".$values["quarter"]." ".year(curdate()).""; |
![]() |
Sergey Kornilov admin 3/8/2022 |
What @david22585 suggests will work, except you need to use BeforeAdd event. |
D
|
david22585 3/8/2022 |
What @admin said is correct. That was my mistake, and I corrected my post. It should be in the Before Add Event. |