Validating that a range of dates is completed in a group, and updating a status - InfoPath Dev
in

InfoPath Dev

Validating that a range of dates is completed in a group, and updating a status

Last post 03-04-2010 10:22 AM by Keotsuke. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-02-2010 12:01 PM

    Validating that a range of dates is completed in a group, and updating a status

    Hi, I searched through the group, and maybe i was just using the wrong search.... However Here is what I am trying to accomplish... I have a group of data in a repeating table, which I have shown 2 states below.


    Concern                                                 Date Closed

    _________________________________________

    Open Door                                                5/5/10

    Open gate                                                1/9/10

    Old Browser

    Total Issues: 3                         Status: Open Issues

    **************************************************

    Concern                                                 Date Closed

    _________________________________________

    Open Door                                                 5/5/10

    Open gate                                                 1/9/10

    Old Browser                                                 4/19/09

    Total Issues: 3                          Status: Issues Closed



    My questions is how to query the date closed fields, and if there are none blank, then change status to "Issues Closed"

    Any help would be appreciated, I have search all over the net...

    I am a fluent VB program, but would prefer not to use any programming to do this... I have tried conditionals, different versions of the "double eval" trick, which I dont altogether understand but....,

    Thank you in advance!

    Please forgive my rusty HTML.... Keo

  • 03-03-2010 03:39 PM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    It seems like you could use a conditional default value (which can be created with substring formulas, described here). But first, do you need to be storing the status value in your form? Or could you just use two expression boxes, one that says "Issues Closed" and one that says "Open Issues", then use conditional formatting to show and hide the correct one....

    Hilary Stoupa

  • 03-04-2010 06:06 AM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    Thank you for your quick reply! I am storing the data in the form, as I will be submitting this to a sharepoint site. I cant seem to get the conditional formatting to work for me... I have attached the sheet that I am creating.. I think the problem that I am having is comparing all of the values in the "DateComp" fields. If I were to write this in basic, it would look something like this:

    StatusState = 0

    For Each Date in DateComp

    If DateComp > "" then

    else

    StatusState = StatusState + 1

    next

    if StatusState > 0 then Status.text = "Open Issues"

    Basically if any of the datecomp fields is blank then the status is "open issues"

    Thank you for your help!

    Keo

  • 03-04-2010 08:17 AM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    Thanks for attaching a template, I've added a conditional default to your Status field, and attached to this post. See if this helps, okay?

    Hilary Stoupa

  • 03-04-2010 08:39 AM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    That works perfectly!!! You are a Goddess!

    I would like to understand it a little more if you wouldnt mind explaining it to me. :-)

     I dont really understand the "* string-length" part, also what does the "1" signify?

    Thank you so much!!!

    Keo

     

     

  • 03-04-2010 09:05 AM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    String length wouldn't technically be necessary here, since we know what the length of your strings are (Open Issues and Issues Closed) but I wanted to use it in the formula anyway, since we would need it if we were using a field rather than a predefined string.

    Basically, we have concat formula that consists of two substring formulas. Depending on the evaluation of a condition, only one of those strings will be returned. The substring formula takes three arguments -- the string, the starting position and the length of the substring to be returned. In the first substring formula, we have a string "Open Issues", and then the argument 1, stating we'll begin at the first character of the string. The length argument has been replaced by a boolean condition in parentheses multiplied by the total length of the string that we define in the first argument. The boolean evaluates to 1 or 0. So, 1 * the length of our string would equal the entire string. 0 times the length of our string would return nothing.

    In other words, our first substring in our concat formula says: if there are any blank DateCompleted fields, return 0 characters, otherwise return ALL the characters. The second formula works the same way, except with a different string ("Issues Closed") and with the reverse condition (if there are NO blank DateCompleted fields). Whew. I probably just made it all the more confusing, but I hope this helps....

    Hilary Stoupa

  • 03-04-2010 10:22 AM In reply to

    Re: Validating that a range of dates is completed in a group, and updating a status

    That made perfect sense to me!

    Thank you so much! When I first started this infopath/sharepoint stuff, it was so hard to find resources!  Thankfully I stumbled on to this forum!

    I just dont understand the logic in NOT just supplying simple IF THEN ELSE statements however.... Oh well!

    Your the best! :-)

     

    Keo

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