Set default value of a field conditionally - InfoPath Dev
in

InfoPath Dev

Set default value of a field conditionally

Last post 09-26-2013 01:24 PM by Shrout1. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-26-2013 01:24 PM

    Set default value of a field conditionally

    The attached XSN file gives a decent example of what I am trying to do.

     I need a field inside of a repeating section that either defaults to the "Master" field at the top of the form *or* grabs the last iteration of itself (from the last copy of the repeating section).

    In my XSN template I have the necessary XPath expressions to accomplish this... There are a couple problems, however:

    1.  If a field is set to "Refresh value when field is recalculated" then a cascade effect is triggered any time the "Master" field is changed. All the copies of the field in all repeating sections are wiped away and replaced. Furthermore, trying to change any of the fields in the repeating section does not work because it recalculates and defaults back to the value of its neighbor above (see the XSN template for a good example of this; middle column).
    2. If a field is *not* set to "Refresh" then it stays blank until typed into. The first instance of a repeating field exists the moment that the form is created; in that moment the entire form is blank. Therefore the repeating field is blank, and because the default value does not recalculate, it will never contain data unless someone types into it manually. The third column in the attached XSN contains this example. (Note: All children of this field calculate on creation and have the ability to grab the appropriate field if that other field has a value when they are created)
    3. If a rule is applied on the "Master" field at the top of the form, that rule will blindly replace every instance of a repeating field whenever *any* of the repeating fields are modified. Please look at the first column within the attached XSN file for an example of this problem.

    I do not see a clear resolution to this problem between using a rule and not refreshing the field.

     My apologies that this question seems so complex; the concept itself is rather straightforward, I simply lack an adequate means of expressing it.

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