I’m trying to replace a formula in a field called Readers with this one:
@Name([CN];Name:DeptEA:“[Admin]”:Manager:directreport:creator:“[HR]”:Projread:“MYSERVER/ABC/US”)
This is the formula I am using:
FIELD Readers:=“@Name([CN];Name:DeptEA:”[Admin]“:Manager:directreport:creator:”[HR]“:Projread:“MYSERVER/ABC/US”)”;
SELECT @All
When I try to save, I get the error:
An operator or semicolon was expected but none was encountered: “‘Manager:directreport:creator’”
I don’t know what is wrong here. Can anyone give me some input?
Thanks in advance
Helen
Subject: RE: Formula Help Please
I’m trying to replace a formula in a field called Readers with this one:@Name([CN];Name:DeptEA:“[Admin]”:Manager:directreport:creator:“[HR]”:Projread:“MYSERVER/ABC/US”)
This is the formula I am using:
FIELD Readers:=“@Name([CN];Name:DeptEA:”[Admin]“:Manager:directreport:creator:”[HR]“:Projread:“MYSERVER/ABC/US”)”;
SELECT @All
If you want to put a formula in a computed field, just put the formula in the computed field. You should not use a FIELD statement. The result returned by the formula will be assigned to the field, without your doing a specific assignment.
Never use @Name([CN]…) in a Readers or Authors field. Store the canonical name, or it will not work to grant access in all contexts.
So your formula would be:
Name:DeptEA:“[Admin]”:Manager:directreport:creator:“[HR]”:Projread:“MYSERVER/ABC/US”
Except that I would also caution against hardcoding any names into your design. Do you really want to have to review all your database designs if you add or rename a server? “MYSERVER/ABC/US” should not have to be listed in every document; just add the server to the Admin role. Also, if any of those fields might be blank, you should trim the value, and use @Unique to avoid duplicates.
@Unique(@Trim(Name:DeptEA:“[Admin]”:Manager:directreport:creator:“[HR]”:Projread))
Subject: RE: Formula Help Please
Andre,Thanks so much for your quick response. I am very grateful for that. This db was inherited from someone. I am not a developer, but expected to fix it.
I did put the server in the Admin role, but I guess because of the hard coding it wasn’t working.
Is there a way to find all the readers fields in the db and change it via the formula to reflect the new server name?
Thanks again
Helen
Subject: RE: Formula Help Please
You seem to be expecting that you can change a formula on a form and that it will update existing documents. This is not the case. The formula is only applied when the document is edited and saved. Until then, the access characteristics of existing documents do not change. Please see this: Compleat Reader and Author Field Troubleshooter.
Incidentally, a hard-coded name in a Readers field does not prevent access for the same ID via a role name.
If the above does not solve your problem, you might read the C R I S P Y document and consider its recommendations. We would need you to describe exactly what you did and what the result was. “Does not work” is a little vague.
- Andre Guirard, IBM/Lotus Development
Useful blog: Best Practice Makes Perfect
Subject: RE: Formula Help Please
actually the server should be entered as “CN=MYSERVER/O=ABC/C=US” in order for it to work correctly.