We help IT Professionals succeed at work.

Hide embedded view

jforget1
jforget1 asked
on
553 Views
Last Modified: 2013-12-18
Having trouble again with the hiding of an embedded view. I want the view only to be visible to users with the OFFICE role and only when the hide_user field does not contain "hide". I have tried every combination I can think of but can't get this one to work. I have tried the !(@IsMember("[OFFICE]";@UserRoles) method for each item, but I still always see the item. I have tried the | (or) option, but it will not work for me.

@IsNotMember("[OFFICE]";@UserRoles) & hide_user = "hide"
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Tried this code which is interesting, have never used an @IF in hide code before. But it does not want to work, I have tried the hide_user both with the hide value and empty and the view never hides. Strange, based on the logic shown this should work.

Commented:
I assume you are using the database on a server, or locally with "Enforce a consistent Access Control List across all replicas" selected?

Otherwise User Roles do not work

Author

Commented:
This is on a server and I have the consistent ACL enforced as well. I just tried taking the OFFICE role off myself, which then does hide the view. For some reason that hide_user factor is not coming into play.

Commented:
@if function is good to use in hide-when formulas, when we have several conditions to check.

If the database is on local machine, then it is like daj_uk wrote, the "Enforce a consistent Access Control List across all replicas" must be switched on in ACL of database, and even then the hide formulas are not working very well. Sometimes it is need to close Notes and re-open it to flush cache and get roles working.

Other place to check is field hide- is it populated correctly?

Sometimes is good to use computed text to see what's going on. Use the same formulas with @text() in computed text and see, if they get the expected values.

Author

Commented:
OK I have put the formula in a computed field just to see the value and no matter if the value in the hide_user field is Hide or not, I get a Zero as the value in the field. How can the value be the same for both?

Author

Commented:
OK right now I feel like a jackass and apologize for this one going on so long. The field is hide_users and not hide_user. When I started the code for the hide I dropped the S. Thanks to all for the help.

Commented:
It suggests that problem is with role checking.

Test @IsMember("[OFFICE]";@UserRoles) at first and see, if it evaluates correctly to 1 when user has role OFFICE, and 0 when user has no role.

If this works perfectly, then test in another field just the value of field "hide". If it displays "hide" correctly, then it's OK with it.

After that, check both formulas together, like daj_uk suggested, and see if result evaluates to correct number: 1 or 0.

Commented:
Been' there ;-)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.