Effective Section Validation

Comments

12 comments

  • Official comment
    Avatar
    AgilePoint NX Support

    Hello Doug,

    Yes, you can validate the section using the helper method. Please refer the below link for details:

    https://documentation.agilepoint.com/11/developer/cloudjsValidateSection.html

    Or you can use the Validation rules in the Section settings.Please refer below link for details:

    https://documentation.agilepoint.com/00/appbuilder/cloudformeFormSectionSettings.html

     

    Thanks,

    AgilePoint Support

     

    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    Thanks for your response.

     

    On helper methods my assumption is that they are there so that you can force the validation when you want to but you can't make the validation be whatever you need it to be in the method.

    On section validation rules they don't seem flexible enough to do what I need.

     

    Here's what I have

     

    Radio 1

    Option 1 - "A"

    Option 2 - "B"

     

    Checkbox 1

    Option 1 - "1"

    Option 2 - "2"

    Option 3 - "3"

    Option 4 - "4"

    Option 5 - "5"

     

    Checkbox 2

    Option 1 - "Z"

     

    Validation Logic

    If Radio 1 != "A" OR

    If Radio 1 != "B"

    Display "You must select either "A" or "B"

     

    If Radio 1 = "B"

    Then

    If Checkbox 1 != "1" OR

    If Checkbox 1 != "2" OR

    If Checkbox 1 != "3" OR

    If Checkbox 1 != "4" OR

    If Checkbox 1 != "5"

    Display "You must select at least one value in Checkbox 1"

     

    If Checkbox 2 != "Z"

    Display "You must select Z above"

     

    So it's a little complex. How would the above be accomplished?

     

    Thanks,

    Doug

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    Any ideas AgilePoint NX Support?

    0
    Comment actions Permalink
  • Avatar
    AgilePoint NX Support

    Hello Doug,

    Open Form Sections on the Form Builder Menu and click on validation rule and provide rules for the particular section where Radio buttons and Checkboxes are present.See attached for reference.Thanks

     

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    Thanks.

    OK I did exactly as above. The first and last set of rules are easy. It's the middle one that is not doing what I need and I think I know why.

    I need the first rule above to only be used in conjunction with the second set of 5. So when my first Radio has option one selected the above isn't in play. Or at least Type of Request is evaluated and the second set of 5 is never reached. Notice my AND When notation in the shot. This needs to be evaluated as a compound rule. So when Radio 1 Option 1 is selected Rule 1 above is evaluated only for the purpose of reaching the nested set of 5, which it shouldn't. Only the nested set of 5 determine if the Failure is displayed. What is actially happening is Rule 1 above failes as it should and based on that alone the faulure message is displayed. So even though the nesting is an implied AND it is acting like an OR.

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    Any ideas AgilePoint NX Support?

     

    0
    Comment actions Permalink
  • Avatar
    AgilePoint NX Support

    Hello Doug,

    The concept of rules as per your use case is explained below:

    IF (Condition1 && (Condition2 || Condition3 || Condition4 || Condition5))   

    If the above condition fails, then the "Condition failure message" will be displayed.

    Else, please raise a support ticket for further assistance.

     

    Thanks,

    AgilePoint Support

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    You condition statement is correct.

    IF (Condition1 && (Condition2 || Condition3 || Condition4 || Condition5))   

    My field selection that should pass validation is this.

    • Condition 1=True
    • AND
    •     Condition 2=True
    •     OR
    •     Condition 3=False
    •     OR
    •     Condition 4=False
    •     OR
    •     Condition 5=False

    Based on your above set of conditions validation should pass because Condition 1 is true and Condition 2 is also true.

    When Condition 1 is false my intention is to NOT even evaluate conditions 2-4. It's purpose is not to validate but to reach t he second set of conditions if true.

    Another way to try this would be.

    IF (Condition1 && Condition2)

    OR

    IF (Condition1 && Condition3)

    OR

    IF (Condition1 && Condition4)

    OR

    IF (Condition1 && Condition5)

    In other words When Condition 1 is true then one of Conditions 2-5 must also be true ELSE I display validation warning.

    Before I raise a support ticket do you see any way to do the above in section validation. There doesn't seem to be enough flexability/granularity when placing AND/OR logic between conditions.

     

    0
    Comment actions Permalink
  • Avatar
    AgilePoint NX Support

    Hello Doug,

    Your understanding is correct. Let us narrow down to just Condition 1 and Condition2 for now.

    If (Condition1=True && Condition2=True),then no condition failure message.

    Screenshot 1:

     

    If (Condition1=True && Condition 2=False),then display the condition failure message.

    Screenshot 2:

    If (Condition1=False && Condition2=False), then it would display the Condition failure message.

    Screenshot 3:

     

    The above scenarios work as per the AND logic(True && True=True). May I please know what exactly you feel is an issue?

     

    Thanks,

    AgilePoint Support

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    AgilePoint Support,

    Everything you have above is correct but not my desired result.

    Keeping it at Condition1 & Condition2 my requirement is that if Condition 1 is False then Condition 2 doesn't matter. 

    Is there any way to make that work in the UI based rules?

    If not what I really need is a onBeforeSectionNavigate event. There is only an onSectionNavigate which happens after navigation. If there was an onBeforeSectionNavigate event I could fill my form js with section navigate functions and do whatever I want.

    Thanks!

     

    0
    Comment actions Permalink
  • Avatar
    AgilePoint NX Support

    Hi Doug,

    As per your requirement,please find the below screenshots:

     

    Hope this helps!

     

    Thanks,

    AgilePoint Support

    0
    Comment actions Permalink
  • Avatar
    Douglas K Steckel

    AgilePoint Support,

     

    Thanks! That worked.

    If you don't mind one last question as part of my difficulty was understanding the below. When I did have one of my rules set up with an inner rule as shown below, what is the implied relationship of the outer and inner set of rules. Maybe there just is none. Maybe you want to evaluate one set of fields using the "All" and another set using the "Any" but both display the same validation error. If that's the case I think the indent of the second set of fields messed me up as it seemed to imply a relationship between outer and inner.

    Thanks again!

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.