Link to home
Start Free TrialLog in
Avatar of NavHard
NavHardFlag for Pakistan

asked on

Wrongly Entered Readers Field in Lotus Notes Document

Mistakenly while updating the document through LotusScript I have appended some value in and item which was basically a notes reader field on the form. Now the problem is that this document has not been accessed by anyone not even the one who created it. What can I do?? Can I retrieve the document and update the reader field?? Is there any method ?? The code for updating the reader field notesitem is attached for reference.
I don't know what went wrong because same code is running perfectly fine in an other database.

Dim s As New NotesSession
	Dim db As NotesDatabase
	Dim docs As NotesDocumentCollection
	Dim n As NotesName
	Dim ws As New NotesUIWorkspace
	Dim nameVar As Variant
	Dim doc As NotesDocument
	Dim item As NotesItem
	
	Set db = s.Currentdatabase
	Set docs = db.Unprocesseddocuments
	nameVar = ws.Pickliststrings(PICKLIST_NAMES)
	If nameVar(0) = "" Then
		Msgbox "Please select any name to continue",64,db.title
		Exit Sub
	Else
		Set n = New NotesName(nameVar(0))		
	End If
	
	Set doc = docs.Getfirstdocument()
	If doc Is Nothing Then
		Msgbox "No document is selected, Can't proceed",64,db.Title
		Exit Sub
	End If
	If ws.prompt(PROMPT_YESNO,db.Title,"This will change current desk to the selected user in selected document, Do you wish to continue?")Then
		While Not doc Is Nothing			
			doc.CurrentApprover = n.Abbreviated			
			Set item = doc.Getfirstitem("WorkflowReaders")
			If Not item Is Nothing Then
				Call item.Appendtotextlist(n.abbreviated)
			End If
			Set item = doc.Getfirstitem("fl_Readers")
			If Not item Is Nothing Then
				Call item.Appendtotextlist(n.abbreviated)
			End If
			
			Call doc.Save(True,False)		
			Set doc = docs.Getnextdocument(doc)
		Wend
	End If

Open in new window

Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Options:
1. revert to a backup
2. use the Full Access Administrator option to handle all documents
Avatar of NavHard

ASKER

Unfortunately backup copy is replicated and document is vanished from there as well. How can Full Access Administrator would handle it?? Can you please clear ??
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NavHard

ASKER

Can you tell me lastly what went wrong in my code. What should I change in it?
Yep. The code isn't exactly right, with respect to  the Readers fields. Check in an existing document, using the Document Properties window, what the contents are of a Readers field. You'll see something like "CN=Jack Daniels/O=Whiskey", so not the abbreviated name but the full canonical name. It MUST be in that form, otherwise it won't work.