Hide When for edit on a document

I have a project form in a project tracking database.  On the form, I want anyone to be able to create a New Project but I only want the Project Manager to be able to edit the document after it is created.

I have created a display field to show the Team Members the project information. I just can not figure out the Hide When on the Input Fields and the Display fields. So far I have:

On the Project Doc field that the PM can edit, I have this Hide When:

!@IsNewDoc | pMember!=@Name([CN];@UserName)

On the Display Field for the Team Members I have

@IsNewDoc | pMember=@Name([CN];@UserName)

This is just not working for me.  When I open the document to create a new form, I have to put a PM Name in and then all the fields are hidden, so that is not good.

Any help would be great!!! Thanks
Who is Participating?
The editable field:
!(@IsNewDoc | pMember=@Name([CN];@UserName))

hide when not (a new doc or the names match)
= show when (new or match)

The display field should be opposite.... remove the "!"
For the editable fields, the hide formula should be...

!(@IsNewDoc | pMember = @Name([CN];@UserName))

... and for the non-editable fields...

(@IsNewDoc | pMember = @Name([CN];@UserName))
A tip regarding boolean logic:

If you need to invert an expression, you need to invert everything including the operators.  Placing the entire expression inside of parenthesis and adding a NOT operator is the easiest way to invert an expression, but you can do it manually.  For example, these two expressions are the same...

!(@IsNewDoc | pMember = @Name([CN];@UserName))

... and ...

!@IsNewDoc & pMember != @Name([CN];@UserName)

... Notice that we inverted each value in the expression as well as the operator (ie: ANDs switch to ORs and vice versa).
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Also, you might consider using sections so that you do not have to change the hide/when on individual fields or paragraphs.

I hope this helps !
Also, you should consider using an "Authors" field for "True" security.
kali958Author Commented:
Thank you so much!!! That is the answer i was looking for.  I wanted to split the points due to you both gave answers I could use
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.