?
Solved

Modifying Dynamic Author Fields

Posted on 2001-06-21
5
Medium Priority
?
218 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

765 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