Method Community

 

Setting a default date/time

Last post 04-30-2014 10:48 AM by Anonymous. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-28-2014 8:54 AM

    Setting a default date/time

    I have a date field on one of my screens and I'd like to set the default date to January 1st of the current year. I know how to take the date from the current session and put this into an action result but how do I reflect that in the field? Do I need to specifically populate in on screen load with an action? Or can this action result be placed on Page 1 of the properties of the date/time object. It's unclear to me what can go in that field - just a date or can action (or shared) results go in there, too.

    Thanks 

  • 04-30-2014 9:36 AM In reply to

    Re: Setting a default date/time

    Hi MikeB,

    I believe you are referring to the "Default Value" option on Step 1of5 for the "datepicker" properties, however you are correct this is where you would manually input the value you want.

    I provided a screenshot below of the how I filled mine out, I tested it after, as soon as I load this screen, the date populates with Jan-01-2014.  Technically, you can also do this as you said, from the "OnScreenLoad" function.  Simply add an "Enter Value on Screen" action, and 'type in' your date here, this will do the same as using the default value in the datepicker properties, but would require a bit more work.  If you do have an action result for this value, then you would likely need to add it using the "OnScreenLoad" function.

  • 04-30-2014 10:17 AM In reply to

    Re: Setting a default date/time

    But my question was: can I only put actual dates in the "datepicker" (on page 1 of 5)? Or can that field be dynamic and be filled with an action result or a shared result?

  • 04-30-2014 10:48 AM In reply to

    Re: Setting a default date/time

    MikeB,

    Sorry, maybe I wasn't fully clear, yes you can only use a specific date, manually entered in this field.  If you want to use action results/shared results, you would need to use the action "Enter Value into Field on Screen, just use the "Action Result" option instead of the 'Type In' option, likely from the 'onScreenLoad' function.

    -Ben

Page 1 of 1 (4 items)