Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank - InfoPath Dev
in

InfoPath Dev

Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

Last post 04-26-2012 03:54 PM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-26-2012 01:21 PM

    • hotb0x
    • Not Ranked
      Male
    • Joined on 04-26-2012
    • PHX
    • Posts 5

    Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

    Sounds easy enough..I've also searched the forums but wasn't able to find what I needed.

     

    I looking to simply have a checkbox marked TRUE if date field is yet to be filled out or a drop down is yet to be filled out (drop down is linked to external data source). It works if I fill in a date then delete it or select a drop down and set it back to empty but not sure how to trigger it by default. Any suggestions?

     

    I've tried if FIELDNAME = is blank and also if FIELDNAME is not present. neither trigger by default.

  • 04-26-2012 02:07 PM In reply to

    Re: Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

    Hi -

    Well, the issue is that rules only fire when fields change.

    What I'd do is set the field that is bound to the checkbox to have a default value of true - after all, when the user first starts filling out the form, they won't have entered a date, or selected from the drop down.

    Then, add rules to the date field and the drop down to set the checkbox field to false when they change and are not blank (and leave your rule for setting back to true, in case the user comes back and clears the date field or drop down).

    So - logic is:

    Checkbox field defaults to true
    User enters date - rule runs and sets checkbox field to false if date is not blank
    User clears date - rule runs and sets checkbox field to true if date is blank

    Same for the drop down field.

    Does that make sense?

    Hilary Stoupa

  • 04-26-2012 02:42 PM In reply to

    • hotb0x
    • Not Ranked
      Male
    • Joined on 04-26-2012
    • PHX
    • Posts 5

    Re: Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

     Hi!

     Yes that does make sense and I really appreciate the response, but let me ask you this... What I am doing is adding a new "pending" checkbox/field to a current infopath form. If I add it with the checkbox defaulted to true will it add it to all previously saved records as true?

  • 04-26-2012 02:54 PM In reply to

    Re: Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

    Yes, it will - but you can add a form load rule to handle for that.

    In your form load rules you could have a rule with a condition that if the date field or the drop down field are not blank, set the checkbox to false.

    Since you have existing forms / data, you should preview with some existing XML to make sure your changes work as you'd anticipate. Here's a blog post on that - the screenshots are from IP 2007, but once you open the Form Options (from the File backstage in IP 2010), it is the same from there.

    Hilary Stoupa

  • 04-26-2012 03:46 PM In reply to

    • hotb0x
    • Not Ranked
      Male
    • Joined on 04-26-2012
    • PHX
    • Posts 5

    Re: Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

     Thanks!! I did not realize you could preview current xmls with a new forms. The form load rule will only apply when someone is opening the form correct... so If I add in a checkbox with a default of TRUE and publish would it add this field to all current xmls? Or are you saying each xml would have to be opened and saved in order for the new value to be seen?

  • 04-26-2012 03:54 PM In reply to

    Re: Set checkbox to True when either date field is empty/blank OR if drop list is empty/blank

    Each XML has to be opened with the new template for the new field to be added - and under form options, check your versioning settings to make sure you have the form template set to upgrade existing XML or they will not have the field added when they are opened.

    Hilary Stoupa

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