16
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

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

Champion

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,

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

Solution 1: If you use DatePicker 


Solution 2: If you want to change on preparation 

S

Champion

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,


I already change to use input_calendar and it works.

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

mvp_badge
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.