Rules - InfoPath Dev
in

InfoPath Dev

Rules

Last post 08-18-2014 07:23 AM by donstephen. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-13-2014 01:49 PM

    Rules

    I am wondering if it is possible to create a rule or something that does the following.

    I have a box that contains number of devices, below that i have a list of row where serial numbers are filled in. Is it possible to create a rule that looks at the number of devices and then requires that many serial numbers to be entered?

  • 08-18-2014 02:17 AM In reply to

    Hi zmbaker13,

    This sounds do-able. May I know if the box which contains number of devices is simply an integer field? If so then you can impose a disable rule to you control buttons or field and display an error message if box is not equal to count(RepeatingGroup). If this approach doesn't work for you, kindly attach a sample of your form so I may have a clearer idea of what isn't working for you.

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 08-18-2014 05:17 AM In reply to

    Yes the box that contains the number of devices is an integer field, what would be the steps to applying a disable rule.

  • 08-18-2014 07:23 AM In reply to

    Hi,

    I've attached a sample form which shows an error message and disables a control button if the number of rows (with data) is not equal to the number of items specified in the box. To add a formatting rule, you must click the Manage Rules located along the Home Tab,  click on the control button or section, click New and select Formatting under the rules task pane, add a condition located at the middle portion of the rules task pane (you may follow the condition I created on the attached form), then select Hide or Disable. Note that the conditions for hiding and disabling controls are inversely proportional in order for it to work properly.

    The first condition I added uses a formula count(group2[field2 != ""]) - you may set this by clicking the Use formula, use a count() function, and insert the repeating group inside the parentheses. Also, I added a filter here to make sure that the repeating field should not be blank. You may opt not to add this filter (should not be blank) condition.

    The next condition I added is to make sure that the number of repeating rows should be equal/not equal (depending on the format rule) to the number specified in the box.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.