Solved

Modifying Dynamic Author Fields

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now