Make section visible depending on current time - InfoPath Dev
in

InfoPath Dev

Make section visible depending on current time

Last post 04-24-2012 08:11 AM by andrewb. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-30-2012 12:12 PM

    Make section visible depending on current time

    Hi all, first post.

     I'm designing a form here at work in IP2010 that will be published to SP2010 site.

     This is what I'm looking for.

     If user hits submit on the form, the logic should check the current time. If current time is greater than 5:00pm Eastern time, a message pops up saying, "it is after 5pm your request will not be processed until next business day etc"

     Any idea on how to go about this?

     Thanks in advance!

  • 03-30-2012 12:54 PM In reply to

    Re: Make section visible depending on current time

    Currently I have a currentTime field where the Default Value = now()

     Then I have a section with the message. I'm thinking I need to set a Formatting Rule on the section, something like if currentTime is less than 5pm "Hide this control".

    How would I write that? currentTime < 17:00:00   ???

    I know that doesn't work, but I think I'm onto something?

     

     

  • 03-30-2012 02:49 PM In reply to

    Re: Make section visible depending on current time

    Hi - You'll first want to make sure in your rules you are setting your currentTime field to now() when the user submits - so that it has the time when the button is clicked.

    To get just the time, you need to use substring-after - it would be something like substring-after(currentTime, "T") - IP date time is ISO, has a T between the date and the time....

    I guess you could also do something like currentTime < concat(today(), "T17:00:00") - you'll need to experiment a bit. Oh, and you could just set your currentTime field to a substring-after(now(), "T"), so it does just have the time....

    Hilary Stoupa

  • 04-02-2012 11:03 AM In reply to

    Re: Make section visible depending on current time

    Thanks so much! I did the last thing you mentioned, just returning the current time using the substring on my currentTime field. Set my warning message (section) to display if currentTime is greater than "17:00:00". Works great! Thanks again.

  • 04-24-2012 07:09 AM In reply to

    Re: Make section visible depending on current time

    Hilary - I implemented the substring-after(now(), "T") and it shows the time only which is what I wanted! However, when I published to SP and tried to submit the form I got an error stating, "Only date or date and time allowed". Does this mean I can't just have time?

  • 04-24-2012 07:45 AM In reply to

    Re: Make section visible depending on current time

    What is the data type of the field you are setting? You may need to change it to Time or Text.

    Hilary Stoupa

  • 04-24-2012 08:11 AM In reply to

    Re: Make section visible depending on current time

    DateTimeType - I didn't see one to pick from the lsit just for Time - I will try out Text, thanks

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