1812
Views
7
Comments
Solved
How to set date input default value
Application Type
Traditional Web

Hi  Everyone

I have an input binding to an Entity's Date type attribute.

What I want to achieve is

If the attribute already has value(<> 1900-01-01 NullDate) then display the value, else set it to the current date.

Thanks

2017-07-15 18-41-36
Sachin Mahawar
Solution

Hi Tom,

You can check the value of the variable with the NullDate on preparation and if the variable has NullDate you can assign it to the CurrDate(). Is that what you are looking for?

Sachin

2021-01-19 14-07-32
Tom Zhao

HI Sachin,

Thanks for your reply. I'm sorry I haven't explained my question very well.
The input is in the list retrieved from Advance SQL Tool(Not aggerate),

Is there any way without using a loop and use the logic as you mentioned to set the date?

Kind regards,

2017-07-15 18-41-36
Sachin Mahawar

Hi Tom, 

Two choices are there, either you can manage it in the query itself by putting if-else case or you have to iterate the list returned from SQL and check each field manually to set.

Sachin

2020-04-30 03-53-13
Thanaphat Chirutpadathorn

Solution 1: If you use DatePicker 


Solution 2: If you want to change on preparation 

S

2021-01-19 14-07-32
Tom Zhao

Hi Thanaphat,

Thanks for your reply. 

I already tried your first suggestion before, but no success.

Although  I use Input Calendar not DatePicker

Kind regards,


2020-04-30 03-53-13
Thanaphat Chirutpadathorn

I already change to use input_calendar and it works.

I check the null date on preparation and assign CurrDate() to it.

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Tom Zhao

Please find the attached oml for solution.

Regards,

Manish Jawla

DateInputCalendar.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.