Solved

Modifying Dynamic Author Fields

Posted on 2001-06-21
5
215 Views
Last Modified: 2013-12-18
Hello All

Does anyone have any sample code (formula and Script if possible) that modifies Author/reader fields?

I've never really refined access that far before, and I'm in a big hurry, so anything I can rip off would be most appreciated...I've even being generous with the points...

Cheers

Ian
0
Comment
Question by:IanWood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:sloeber
ID: 6213980
What do you mean with modify
Just set the folowing in the author/readers field
@Name([CN];@UserName) : "[Role]" : "Name" ..........

May be a little hint, say that you have several Divisions in your company.
Only the persons with the same division may read the document
Then you have in your form a dblookup that looks to the users division, and put this in the field Division

So, in the readers field you wright now
"[" + Division + "]"

Is this enough explanation or do you need more.
Always use the [CN] name, in a readers field, except for roles ;-)

Greets,
Sloeber
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 100 total points
ID: 6214098
run this agent on selected documents,

dim session as new NotesSession
dim db as notesdatabase
dim col as Notesdocumentcollection
dim doc as notesdocument
dim item as Notesitem

set db = session.CUrrentDatabase
set col = db.UnprocessedDocuments
set doc = col.GetFirstDocument
while not doc is nothing
set item = doc.GetFirstItem("Author")
Call item.AppendToTextList( "Ianwood/ou/o" )  ' use this if you want to add some name to the existing authors field
doc.Author = "Ianwood/ou/o" ' use this if you want to replace ahole authors field
item.IsAuthors = true
call doc.Save(true,false)
set doc = col.GetNextDocument(doc)
wend

PS: Similarly for readers field use, item.Readers=True

~Hemanth
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6214109
I believe that it's also necessary to refresh the documents, but I'm not sure
0
 
LVL 1

Expert Comment

by:anuu
ID: 6214924
hey Hemanth,

A small clarification... if  a document does not already contain an Authors field, then wont it spring up an error on getfirstitem method?


anu
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6215001
Anuu you are right!

The question says that, he wants to modify the field, so I assume that he has one.

If you don't have one then use extended class syntax that I commented out in the script.

To Ianwood

Comment out this line, somehow I missed it

' doc.Author = "Ianwood/ou/o" ' use this if you want to replace whole authors field

~Hemanth
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question