QRules DateDiff Calculate half day - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

QRules DateDiff Calculate half day

Last post 05-26-2016 08:56 AM by joegood. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 05-24-2016 06:54 AM

    QRules DateDiff Calculate half day

    Hello I am evaluating qrules for a leave request form. However we also need to calculate half days. I specified the controls as date time. I also want to exclude weekends. can some one point me in right direction to achieve the outcome. Thanks in advance
    Filed under: ,
  • 05-24-2016 05:40 PM In reply to

    Re: QRules DateDiff Calculate half day

    What is a half day for you? 4 hours? 12 hours? :) Can you give me a little more info about what you might enter & what you'd expect for an outcome?
    Hilary Stoupa

  • 05-24-2016 11:31 PM In reply to

    Re: QRules DateDiff Calculate half day

    Hello Hilary Our half day is 4 hours. for the leave request user enters start date and end date, with time as an option. I had a thought about just using option of morning or afternoon. Thanks for any advise you can give J
  • 05-25-2016 08:09 AM In reply to

    Re: QRules DateDiff Calculate half day

    I'll try to put together a little sample later today and attach it to a reply. :)
    Hilary Stoupa

  • 05-25-2016 05:03 PM In reply to

    Re: QRules DateDiff Calculate half day

    Attaching a sample that at least shows an hours calc excluding weekends based on an 8 hour day.... sorry, I didn't have a chance today to do much more than this, but hopefully it gives you a jump start. Save the file locally, right click & select design, from there you can preview & look at the logic.
    Hilary Stoupa

  • 05-25-2016 11:43 PM In reply to

    Re: QRules DateDiff Calculate half day

    HI Hilary I did see a similar example from the webinar. In regards to a half day using Qrules DateDiff command, It would be relatively straight forward to calculate the minutes and then convert to hours. Doing it this way though you lose the weekdays component. pity we cant have /component=weekdays, /totalminutes Thanks for your input.
  • 05-26-2016 05:01 AM In reply to

    Re: QRules DateDiff Calculate half day

    Hilary I've noticed a strange behaviour. My form with Qrules and a secondary data connection (GetProfileByUsername) errors on opening. The following query failed: GetUserProfileByName (User: , Form Name: tf1, IP: , Connection Target: , Request: , Form ID: urn:schemas-microsoft-com:office:infopath:tf1:-myXSD-2016-05-26T11-51-03 Type: DataAdapterException, Exception Message: The remote server returned an error: (500) Internal Server Error. A user with the account name could not be found. ---> However the same form without Qrules works with no issue.
  • 05-26-2016 08:04 AM In reply to

    Re: QRules DateDiff Calculate half day

    Yeah, you'll have to get the first value, then the second value and add them together.
    Hilary Stoupa

  • 05-26-2016 08:06 AM In reply to

    Re: QRules DateDiff Calculate half day

    Is this in the browser? Or in preview / filler?
    Hilary Stoupa

  • 05-26-2016 08:13 AM In reply to

    Re: QRules DateDiff Calculate half day

    Hi In preview it works fine no problems. After publishing and opening the form it comes up with the error.
  • 05-26-2016 08:15 AM In reply to

    Re: QRules DateDiff Calculate half day

    Meant to say its in the browser
  • 05-26-2016 08:21 AM In reply to

    Re: QRules DateDiff Calculate half day

    When you add qRules to a form, you are adding code. This then puts the form in the SharePoint Sandbox, which can cause a variety of different behaviors than seen in the same form previously. Are you running the data connection on load? If so, change that (walk through the data connection again, deselect the checkbox that indicates you want the data to load when the form opens). On the QdabraRules finishedLoading node, add a rule with the condition finishedLoading = true. Set the query username field in your data connection to the userName() function in InfoPath, then execute the query and see if that resolves the issue. Attach a copy of your form if you need a hand with this (under the Options tab in a reply).
    Hilary Stoupa

  • 05-26-2016 08:56 AM In reply to

    Re: QRules DateDiff Calculate half day

    Thanks for the update. I have removed the getuserbyprofilename, instead just setting the value from the username() to the accountid on a list. I can pull the required data filtering on username. It appears to work with no errors. I will make the changes suggested. Thanks
Page 1 of 1 (13 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.