Lotus Notes / Domino Designer - Hiding Subforms

How do I hide a subform from view of anyone that is not an originator or approver of the form? (Originator and approver are fields on the form - not roles.) I have tried coding the Section "Hide paragraph if formula is true" with the code below, but that is not working.
@If(!@IsNewDoc | @IsNewDoc & !@Contain(originator; !@Name([CN]; @UserName)) |  !@Contain(approver; !@Name([CN]; @UserName)))

Open in new window

fselliottAsked:
Who is Participating?
 
chuckaliciousConnect With a Mentor Commented:
As sjef said, you should use a computed subform. In the formula, you could use the formula included.

I use it all the time and it works a treat.
@if(@Contain(originator; @Name([CN]; @UserName)) |  @Contain(approver; @Name([CN]; @UserName));"MySubformName";"")

Open in new window

0
 
Sjef BosmanGroupware ConsultantCommented:
The best way to hide a subform is to make it a computed one.
0
 
fselliottAuthor Commented:
Thank you for including the code!
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
chuckaliciousCommented:
Note that the code should be "@containS" ie contains plural, not "@contain". I simply copied that bit from your original post, but you get the idea.
0
 
fselliottAuthor Commented:
Yes, thank you. I added to the code to allow for the role of Admin to be able to view no matter, and also if it was a new doc. The code now reads as:  

@If(@IsNewDoc | @Contains(Originator; @Name([CN];@UserName)) | @Contains(ApproverName1; @Name([CN]; @UserName)) | (@IsMember("[Admin]";@UserRoles)); "Header"; "")

Thanks again!
0
 
Sjef BosmanGroupware ConsultantCommented:
I should have spilled more beans the first time...

Then you'll have to do with just another hint.

I hope you don't have these two people working for you: Jim Watt and Jim Watts
0
 
fselliottAuthor Commented:
Good point, but I'm really flying by the seat of my pants in learning the code. I just keep pulling resources together to accomplish the goal. If I understand your comment correctly as the permissions are still not as secure as they could be, how would I then avoid having Jim Watt view a subform that was created originally by Jim Watts?
0
 
Sjef BosmanGroupware ConsultantCommented:
Heh, that was quick! :-)

You shouldn't use @Contains, but @IsMember
0
 
fselliottAuthor Commented:
Thank you!
0
 
Sjef BosmanGroupware ConsultantCommented:
And don't forget to swap the parameters in those functions! See the Help database...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.