Setting a field value inside a hidden section - InfoPath Dev
in

InfoPath Dev

Setting a field value inside a hidden section

Last post 09-02-2009 04:02 PM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-02-2009 10:15 AM

    • g-man
    • Not Ranked
    • Joined on 08-25-2009
    • Posts 12

    Setting a field value inside a hidden section

    I have a form with a number checklist tasks, each in its own section with a combo box for the status of the task.  Based on other information entered on the form, checklist items may be hidden because they don't apply.  The default value of the status combo box is "Not Started", but I need to change this value to "Not Applicable" if the task's section is hidden (this form is used as the template for a SharePoint site and the status field of each task is displayed on the site).  I have tried setting a rule on the combo box stating if the parent section is not present then set the field's value to "Not Applicable", but evidently rules aren't processed once the device is hidden?  Any suggestions?

  • 09-02-2009 10:41 AM In reply to

    Re: Setting a field value inside a hidden section

     Rules only fire when the field to which they are attached undergoes a change in value.  That doesn't seem to be the situation you have here.  Might it be possible to come up with some other rule logic (on the fields that determine whether the section is hidden or not) that will set the combo box's field at the appropriate time?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-02-2009 11:13 AM In reply to

    • g-man
    • Not Ranked
    • Joined on 08-25-2009
    • Posts 12

    Re: Setting a field value inside a hidden section

    That makes sense that the rules only fire during the change event.  The conditional format for the section is set to when "All Occurrences of" the triggering field != 1.  Unfortunately the triggering field is in a repeating section and I'm not being given the option to select any/all occurrences when creating rules for that field.  Is there a way around that?

  • 09-02-2009 04:02 PM In reply to

    Re: Setting a field value inside a hidden section

     You can use a custom expression on the rule in this situation.  For example:

    not(//my:TriggerValue[. != -1])

     Will be true when all TriggerValue fields are equal to -1, and

     boolean(//my:TriggerValue[. != -1])

    Will be true when one or more TriggerValue fields are not equal to -1.

    So you could combine the second one with

    Dropdown = Not Applicable

    To create another rule to set the dropdown back to the Not Started value when the hidden section is unhidden.

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.