Hi Folks,
I have a panel that need to hide based on a few different conditions. I struggled with it for a while and a colleague, @espinozae, got it to work for me but neither of us can clarify why it works this way and the previous attempts did not work.
This is what finally worked...
or( not(cho_AbsenceType,"Sick"), and( equals(cho_AbsenceType,"Leave"), not(equals(cho_AddSickToLeave,"Yes"))))
This is what we had previously and is seems like it should have worked...
((cho_AbsenceType!="Sick")||((cho_AbsenceType=="Leave")&&(cho_AddSickToLeave!="Yes")))
Also, this next setup seems like it would be more correct than what actually worked since both sides of the "or" function are syntactically the same. Note the not(equals(...)) in both or function arguments as opposed to what worked where the not(equals(...)) is only present in the second argument of the or function.
or( not(equals(cho_AbsenceType,"Sick")), and( equals(cho_AbsenceType,"Leave"), not(equals(cho_AddSickToLeave,"Yes"))))
Can someone tell me why this works the way it does? If I can get a real understanding of this, I think I may be able to apply it moving forward. Also, This sort of logic in rules has often seemed s little murky to me. Is there some sort of proofing mechanism that can scale across many conditions so that these things can be reliably figured out? What a =bout some sort of practical truth tables? I know the whole formula must fire TRUE to hide the control. I suspect this is where the issue lies but I cannot intuit it from just looking at it.
Any help from the kids at the front of the class would be appreciated!
Thanks and kind regards,
Patrick
Best answer by MegaJerk
View original