A button action which makes a notation mail with the document link has been woking well in a form before setting the database property “Allow document locking”.
However, now after allowing document locking, clicking the button by Authors ACL users generates an error: “You are not authorized to …”.
-
Administator ACL user make the mail with the document link without error.
-
Locking document is made by the AppendDocLink function.
-
The document has no DocLockHolders but document.Unlock function returns false when Authors ACL users click the button.
Why? How can I do to solve the problem?
Subject: RE: Document Lock and AppendDocLink
Need details. Show code. Which document is being locked (the one you’re linking to or the memo doc)? On which line does an error occur?
Subject: RE: Document Lock and AppendDocLink
The following LotusScript makes the error only when the Database is allowed to lock documents.
The problem line in the code is one that starts “Call it.AppendDocLink(doc …”. Either eliminating the line or stopping allowing for the database to lock documents enables the code to work.
Sub Click(Source As Button)
Dim HelpDeskMailAddress as string
HelpDeskMailAddress = "CN= XXXXXX XXXX/O=XXXX"
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
Dim doc As NotesDocument
Set doc = uidoc.Document
Dim db As NotesDatabase
Set db =doc.ParentDatabase
Dim view As notesview
Dim maildb As New NotesDatabase("","")
Call maildb.OpenMail
If Not maildb.IsOpen Then
Messagebox "Cannot open mail db", MB_ICONSTOP, "Error"
Exit Sub
End If
Dim ses As New NotesSession
Dim mail As New NotesDocument(maildb)
mail.Form="Memo"
mail.Subject = "Link Message:" & doc.Subject(0)
mail.SendTo= HelpDeskMailAddress
mail.CopyTo = ses.UserName
Dim it As New NotesRichTextItem(mail, "Body")
Call it.AppendText(doc.ProductNameJP(0) & "]: " & doc.Subject(0))
Call it.AddNewline(2)
Call it.AppendDocLink(doc, db.Title & " " & doc.Subject(0))
Call it.AddTab(1)
Call it.AppendText("Click the document Link icon!")
Call it.AddNewline(1)
Call mail.Save(True,False)
Messagebox "Please send the mail ..."
Call ws.EditDocument(True, mail, False)
Exit Sub
End Sub
Subject: RE: Document Lock and AppendDocLink
The code looks OK to me – you should contact support and escalate this thru channels. If it’s doing what you say, I consider it a bug.