InfoPath addDays() and set/remove Time. - InfoPath Dev
in

InfoPath Dev

InfoPath addDays() and set/remove Time.

Last post 09-19-2013 06:32 AM by SazWylde. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-06-2013 02:33 AM

    InfoPath addDays() and set/remove Time.

    Hi,

    I have set up an InfoPath Form that deals with booking of Training Courses. In my Form i  have a Date To and Date From fields for the Training Course. I have then created a field called Reminder Date.

    The value of this field is set to Date From +1 using the addDays function. I am hoping to use this field to send an email to the Employee 1 day after the course to ask them to confirm they attended.

    The problem I have is that the field is being set to the day after the course and adding 00:00 to the value. This means the workflow fires at midnight that day. Is there any way I can remove this time or set a specific time for it to fire? ie maybe have it set to fire 24hrs after the creation or modified date?

    Many thanks for any help you can give me.

  • 06-06-2013 05:27 AM In reply to

    Re: InfoPath addDays() and set/remove Time.

    I would first check your date picker control to ensure it's set to only Date and not Date time.

    The addDays function should not be adding a time, unless your original value contains a time.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-07-2013 02:53 AM In reply to

    Re: InfoPath addDays() and set/remove Time.

    Hi Ernesto,

    Thanks for the reply. Both Fields are set to Date Only. It seems to be the Library Column that is set to Date and Time. For some reason the check box in InfoPath that you would usually tick to allow amendment of the Column is greyed out.

    I had a quick play around with it and found that I can edit the Column only of the Reminder Date Field is set to Text but not to Date. I even tried to set the Reminder Date Field in InfoPath to Text and then change the Column in the Library to Date but that still added the time to the field.

    Any ideas?

    Thanks

  • 06-10-2013 05:53 AM In reply to

    Re: InfoPath addDays() and set/remove Time.

    Correct, SharePoint will store a datetime. I didn't realize you had one of the date fields coming from SharePoint. You probably want to set a field value in the main data source, where you can have a clean date field. When you set the value use something like substring-before(SharePointDate,"T") to get only the date portion. Then you can perform addDays.

    In other words, don't do addDays on the value that SharePoint returns. Clean up that value first.

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-19-2013 06:32 AM In reply to

    Re: InfoPath addDays() and set/remove Time.

    Hi guys, I wanted to use the AddDays function to a date taking as a reference today's date. It didn't work because I used this: addDays(now(), 14) so it took date and time despite I have a date only field so I've just tried this: addDays(today(), 14) and it worked fine. Hope it helps anybody...
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.