Rule condition puzzle - InfoPath Dev
in

InfoPath Dev

Rule condition puzzle

Last post 09-27-2015 11:08 PM by abiigdog. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-11-2015 01:09 AM

    Rule condition puzzle

    I have a form that trainers fill out as they watch a trainee to mark their progress, the form is saved into a sharepoint library which contains all the eval forms for all the trainees.

    The manager would like all the trainers, any supervisor, or the trainee that form is about to all be able to view the form, no one else. She wants to avoid the trainee looking at other trainees forms.

    I know on form load if your a trainer or not, field is TrainerAuth only two options are true or false. I also know if your a supervisor on form load, field is SupeAuth, only two options are true or false.

    As for the trainee, when the form is created a field is set to their login name, TraineeLogin, and finally a fourth field called CurrentUser is set to the login name of whoever opened the form.

    My idea was that on form load if TrainerAuth does not equal True, OR if SupeAuth does not equal True, OR if TraineeLogin does not equal CurrentUser, switch the view to a not authorized view with a close form option only otherwise open the form as normal. But it doesn't work and I can't wrap my head around why. Said another way if either TrainerAuth is true or SupeAuth is true or TraineeLogin=CurrentUser open the form as normal, If any single condition is true open the form as normal even if the other conditions are false.

    Anyone know what I'm doing wrong? 

    p.s. I know conditional view switching isn't true security but it's good enough for this project. 

     

  • 09-11-2015 07:51 AM In reply to

    Well, this sounds right - TrainerAuth = true or SupeAuth = true or TraineeLogin = CurrentUser. But currently the view is switching even when one of these conditions are met? Usually when I have a rule that isn't working as anticipated it is because my conditions are not actually being met - XPath / XML is case sensitive - any chance your condition is not being met because the case is off? To debug, you could put text boxes or calculated values on the form so you can actually see the values of the different fields - sometimes that helps.
    Hilary Stoupa

  • 09-12-2015 12:48 AM In reply to

     Yes the view switches to the not authorized view when it shouldn't, I can see all the text boxes and clearly see a true condition exists. SharePoint sends a lower case true value which I have double checked.

    If I use any of the conditions alone it works just fine, but as soon as I add the second line to the condition box using OR it immediately fails. "OR" is the correct operand right if I used "and" all 3 conditions would have to be met.  

  • 09-14-2015 07:12 AM In reply to

    Oh boy. Let's think about this one. I think you do want and - since if all conditions are true, you want to switch views, right? If TrainerAuth != true and SupeAuth != true and TraineeLogin != CurrentUser, then switch views?
    Hilary Stoupa

  • 09-27-2015 11:08 PM In reply to

    I want any one condition being true to deny access, not all three at once. Thanks for your assistance Hilary, but I have waved the white flag and gone a different way now.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.