Message Box Problems! - InfoPath Dev
in

InfoPath Dev

Message Box Problems!

Last post 08-22-2007 04:21 AM by nukkumatti. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 08-08-2007 12:56 PM

    Message Box Problems!

    Alright, so I'm brand new at infopath, so this is probably just a dumb fix.  I've got a rule set to check box # 2 saying that when clicked, if check box # 1  = false, pop up a message box and set check box # 1's value to false.  The problem is, the message box pops up twice, for reasons I cannot explain.  You have to click ok twice before the check box is cleared.  I've tried putting the message box condition before and after the condition that sets the value to no avail.  I only have this rule in one place, and I've tested it on other check boxes on the form and it behaves in the same way.  Do you have any idea what could be causing this / a better way of validating this list of check boxes?  My form has several sequential check boxes where all the previous must be selected before the next may be.

     Also, i'm using infopath 2003.

    Thanks,

    Jeff

  • 08-08-2007 04:43 PM In reply to

    Typically this is caused by some recursion and can happen when there are several interrelated fields. Field A is changed - trigger and change field B which then changes field A again and make the problem repeat.

    What happens is that your condition is true and the pop up occurs but then another rule will fire, update a value, maybe update the trigering field again and generate another pop up.

    A couple things you could try.

    Create a blank form put a field a rule and a message box and see how many times it pops up. Slowly increase complexity until it occurs.

    I like to add expression boxes to debug at these times.  So inbetween each action add an expression box that displays the value or maybe a concatenated list of all of your values. This way you can monitor the values and the sequence they fire to see to better understand the triggers and how they are reacting. Also make your message boxes less generic so you can track each one individually.

     

    Have fun

  • 08-09-2007 05:30 AM In reply to

    Thanks for the response.  As it is now, I've only got the rule regarding one check box.  That is, the condition is true only when one checkbox equals false.  I didn't bother adding all the other ones yet until I tested that it worked.  So, there is only one field, yet the message box rule still happens twice.  I'm stumped!
  • 08-09-2007 05:38 AM In reply to

    Can you post the rules and actions on it or attach your form template to the reply post and I can check it out?
  • 08-09-2007 07:22 AM In reply to

    I made a test template for you to look at.  The top part has just the condition of the first check box being selected.  The bottom has several in succession.  I tried having two different conditions (i.e. if check box 1 = false, post a message box.  Next, if check box 1 = false, set check box 2 = false)

    I've attached the file to the thread, I think.  Thanks.

  • 08-09-2007 07:35 AM In reply to

    OK I looked at the test template you had first and found the problem.

    SInce it is a check box, when you check it or uncheck it the value changes automatically.

    Which engages your rule for if it is false. It displays the message but then you have a second action which sets itself (field 2) to false again, which makes it fire again.  This was the double action I was referring to.

    I have attached a screen shot.  The . means it is referencing itself.  You may have meant for it to change another field instead.


  • 08-09-2007 07:41 AM In reply to

    The xsn is the most helpful for testing.

    You need to modify your second rule to switch from Field 2 to field one.  CUrrently it is setting itself to false, which is redundant instead of Field 1 to false.

  • 08-09-2007 07:52 AM In reply to

    Well, I want it to change itself back to false.  If the first check box is not checked, the second checkbox should not be checked.  So, if the user checks the second check box, and the first checkbox is not checked, I want it to tell them the first task has not yet been completed, and to uncheck the selection they just made.  Otherwise, the second check box will still be selected.

     

    I think though, I may instead try conditional formatting to enable/disable the boxes when they are be able to be selected.  I'm still curious though why this occurs.

     

    Thanks again for all your help

  • 08-09-2007 07:59 AM In reply to

    Right.

    Here is the fix. On your condition (check 1 = False) add Check2 = True. This will prevent the second trigger from being true.

    So (Check1 = False and Check2 = True)

  • 08-09-2007 08:21 AM In reply to

    Alright, thats perfect.  My logic is obviously off today.  Thanks a bunch.
  • 08-22-2007 04:21 AM In reply to

    just a small add. may be it would have been easier to use radio buttons instead of checkboxes as it seems like you actually created rules to perform the functionality which the radio buttons have out of the box.

    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.