Skip to main content

HI, I know many of us have gone through validation issue and might have already knew the best practice as well. But still I am looking for the easiest way to handle the conditional validation on the view control  as shown. I have dropdown list, and I would like to validate Comments textbox (red colored) only if the Decision being selected is Rejection Review, otherwise it should not be validated. Having said that, when user submit the form with rejection review, he should be able to do so with some comments why its rejected. Please help me. Thanks.

 

11645iAC8DCF58F68BAD3B.jpg

Dear ,

 

having the validation as red box is by using "if form passes validation" condition and checking the controls u need.

but this scenario couldnt be applied using 1 condition , because this scenario is only applied if its a rejection .

so u will need to add 2 conditions , mixed by "advanced condition" and "if form passes validation" (this is what i use).

 

advanced condition --> (if drop down list = approve)

then ur block of actions when its approve .

 

advanced condition --> (if drop down list = reject)

AND

if form passes validation (check the comments text area)

then ur block of actions when its a reject .

 

This way will ask for comments area and make it red if its empty , in case of the rejection .

 

Hope it helps!

Regards.


Thank you. I did a little tweak on the rule with your logic and it worked great. Just wonder how to do the following logic

 

If ((Condition1 and condition 2) or (condition 3))

{

    set some variables

       if (condition 4)

       {

            execute block 1

       }

       else

       {

            execute block 2

        }

 

 

}

else if (condition 5)

{

  execute block 3

}


Dear ,

 

Glad to hear , i think ur other question is all about using nested if conditions ...

oh well , in smartform rules , its not possible ... but u could workarround it by using UNBOUND Rules .

so , for ur nested if condition , go create it as an UNBOUND rule ..

 

then inside ur main if condition , go and call "execute another rule" and call that UNBOUND rule .

in this way u could have nested if conditions .

 

Hope it helps!

Regards.

 


Reply