Group conditions in a rule - InfoPath Dev
in

InfoPath Dev

Group conditions in a rule

Last post 11-18-2009 09:33 PM by Qazi Anis. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-18-2009 11:26 AM

    Group conditions in a rule

    Hi guys I am using rules on a button to do validation. This works great. But I also have 2 checkboxes that, if ticked, my validation should not happen.

    I thought of adding a rule with conditions to check if the checkboxes are ticked and if so, there is no action, I just tick "Stop processing rules when this rule finishes". And then I put a rule below that rule that does the validation. This won't work in my case, though, because I have other fields that need validating too, with the same rules, which would mean they never get executed, unless the first rule on the checkboxes fail.

    So I tried using AND/OR in the conditional formatting, like so:
    field is blank or
    stringlength(Field) less than 4 or
    Checkbox1 = False and
    checkbox2 = False


    but this doesn't work. it creates one big if statement, and I need to group some statements. I then tried to do the grouping in the manifext.xml file by adding parenthesis around my statement groups:

    xsf:rule caption="Validate" condition="(my:myField = "" or string-length(myField) < 4) or (my:MyCheckbox = string(False()) and my:myCheckbox2 = string(false()))" isEnabled="yes"

    Unfortunately, this does not group my two statements.

    So how can I do an if/else statement? Or at least, group my conditional statements? Can it be done in the manifest file?
  • 11-18-2009 09:33 PM In reply to

    Re: Group conditions in a rule

    your condition seems to be fairly simple you dont need to be editing manifest file for this

    myfield is not blank               or

    string-length(myfield) < 4       or

    mycheckbox = string(false()) and

    checkbox2 = string(false()))

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.