Today function is not working - InfoPath Dev
in

InfoPath Dev

Today function is not working

Last post 01-06-2016 03:07 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-06-2016 09:35 AM

    • rmakto
    • Not Ranked
    • Joined on 11-20-2015
    • Posts 8

    Today function is not working

    Hi,

    I have one InforPath 2010 browser form published to Form Library. There is a textbox with Date data type. Its default value set to "today()" function. When I open a new form, the textbox is automatically populated with current date (e.g., 1/6/2016) without problem. But, when I open a saved form from previous days, the textbox shows the date when it was first submitted (e.g., 12/29/2015). In other words, "today()" function is not working for saved forms.

    There is no rule that updates this textbox. There is code behind used in the form, but there is nothing that updates the textbox there either. I attached screenshots of textbox properties. Does anyone know what the issue could be? Or, how can I find the issue?

    Thank you.


  • 01-06-2016 01:50 PM In reply to

    Re: Today function is not working

    Hi! In InfoPath 2003, a lot of us thought today() and now() were broken, because they did exactly what you are wanting them to do now. Somewhere along the way that behavior was changed. I'd remove the default value and add a rule instead, in the FormLoad rules (data tab in the ribbon) to always set the field to today(). That ought to get it updated every time the form opens.
    Hilary Stoupa

  • 01-06-2016 02:58 PM In reply to

    • rmakto
    • Not Ranked
    • Joined on 11-20-2015
    • Posts 8

    Re: Today function is not working

    Hilary, you put a smile on my face ). Thank you so much! I totally forgot about this behavior of today() and now() (it's been awhile since I created anything in InfoPath), and the user who reported this as an issue convinced me that it used to automatically update even for existing forms, so I was scratching my head till now.

    Happy New Year! Wish you much health and luck!

    rmakto
  • 01-06-2016 03:07 PM In reply to

    Re: Today function is not working

    Thanks - you as well, and nope, you were NOT imagining things and neither was your user. :)
    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.