5

Overview

I have several Check Box controls across several views. These checkboxes serve as toggles to hide/unhide various sections within the same view.

The relevant rule is set to the section, with a Condition of chkbx1 != "True", and format set to Hide this control. It works fine.

Additionally, at the base of the view, I have a textbox with a default value leveraging an XPath formula.

The XPath is used to create a message based on whether certain boxes were checked. Example below, and it also works fine.

 substring("Box was checked.", 1, (../@chkbx1 = "True")*16)

Problem

However, over the course of developing this series of views, I will periodically go back and re-test. During these tests, I noticed that seemingly randomly, some of these boxes stop triggering their rules. They stop triggering the XPath.

When I go into the field list for XPath, they are still showing. But it's like IP loses track of them, and just ignores them.

This happened previously during this project, and the only solution I found was to completely remove the checkbox, and re-create it.

However, in addition to be tedious, I am nervous about not knowing the cause, nor the frequency.

Does anyone have any experience with this sort of oddity?

I am using InfoPath 2010, with a database connection to Access 2010.

Aaron Contreras
  • 645
  • 5
  • 9
  • 24
  • The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. What are you trying to do with "substring("Box was checked.", 1, (../@chkbx1 = "True")*16)"? – notChosen Sep 26 '17 at 03:47
  • The sentence "Box was checked." is sixteen characters long. When the checkbox is checked, the condition above resolves to 1, and the substring will display the first 16 characters of my sentence. If the box is unchecked, no text appears. – Aaron Contreras Sep 26 '17 at 14:04
  • In this fashion, I am creating dynamic notes logging the information for the form that my user can copy/paste into the notes field of our (separate) application. – Aaron Contreras Sep 26 '17 at 14:06
  • Why do you use textbox's default value and not checkbox's action rule? – notChosen Sep 26 '17 at 16:13
  • The text box populates quite a lot of notes, based on many checkboxes/text boxes. I'm not certain how I could insert each line from individual rules - creating an XPath formula made the most sense to me, and is generally working fine. – Aaron Contreras Sep 26 '17 at 18:22
  • Additionally, I do have some rules keyed to those checkboxes, in the form of collapsing/expanding sections - for the controls that the XPath seems to ignore, similarly the rule isn't firing for it, either. So whatever the issue is, it seems to have to do with the control, and not the XPath, specifically. – Aaron Contreras Sep 26 '17 at 18:23
  • 1
    Ok, I can't say something concrete but here are my thoughts. 1. Check if Textbox has checked 'Refresh value when formula is recalculated' 2. Try change Checkbox value to 1 and 0, so condition will be chkbx1 = 1 3. Set checkbox's postback settings to Always 4. For checkbox's rules you need to check may be there are rules with checked 'Don't run remaining rules' or broken rules amid them 5. If you use Hide and Disable rules, Hide rule must be first in list – notChosen Sep 27 '17 at 05:35
  • You found it! Although most of my checkboxes have the correct defaults, the broken ones are set to "Clear: (Blank)"/"Checked: False" which is way not what I need from them, and why it's failing. Thank you! Post this as the answer so I can award you the bounty. Any idea why the setting on these are so wacky? – Aaron Contreras Sep 27 '17 at 16:03
  • In my case checkbox's default values are always False/True. Are you sure it was not changed by someone? Infopath has a lot of problems already, I don't need another one) – notChosen Sep 28 '17 at 04:04
  • More likely is that I accidentally messed with it, and then copy/pasted that control in different places, re-binding them, but leaving them with the messed up settings. – Aaron Contreras Sep 28 '17 at 16:07

1 Answers1

0

You need to check the checkboxes's default values and rules. There may be broken ones among them.

notChosen
  • 231
  • 1
  • 6