Solved

Modifying Dynamic Author Fields

Posted on 2001-06-21
5
213 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
  • 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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