I have some LS code in a database which is causing the error message:
Notes Error: You are not authorized to perform that operation
The code causing the error is within a script and is given below
The line that generates the error (when run thru debug) is
Call RTitem.AppendDocLink(in_LinkTo,“Click here to bring up the document this message relates to”)
Function SendDocLink(in_To As Variant, in_CC As Variant, in_BCC As Variant, in_Subject As String, in_Body As String, in_ViewIcon As Integer, in_LinkTo As Variant)
On Error Goto ErrorSending
Print "Sending Notification"
SendDocLink = True
Dim CurSession As New NotesSession
Dim CurDB As NotesDatabase
Set CurDB = CurSession.CurrentDatabase
Dim RTitem As NotesRichTextItem
Set MailDoc = New NotesDocument(CurDB)
MailDoc.Form = "Bookmark"
MailDoc.SendTo = in_To
'MailDoc.SendTo = "Peter Kempner/Novelis"
MailDoc.CopyTo = in_CC
MailDoc.BlindCopyTo = in_BCC
Set RTitem = New NotesRichTextItem(MailDoc,"Body")
Call RTitem.AppendDocLink(in_LinkTo,"Click here to bring up the document this message relates to")
MailDoc.InheritedDbTitle = CurDb.Title
MailDoc.Subject = in_Subject
MailDoc.FlowStatus = in_Body
Call MailDoc.ReplaceItemValue("_ViewIcon", in_ViewIcon)
Call MailDoc.Send(False)
Print ""
Exit Function
ErrorSending:
Messagebox Error()
Messagebox "FYI: One or more recipients could not be notified via email at this time.", 0 + 64, "Please note..."
SendDocLink = False
Exit Function
End Function
This routine works fine for me but not for my users.
They are set up as -Default- with Editor access in the ACL whereas I am set up with Manager access
I have looked in the help and on the forum and cannot find anything relating to access restrictions for this method.
It depends on what you are passing to your SendDocLink function for the inLinkTo variable. Could you post the code where you call the function? Because we aren’t seeing what you are passing to that value in the function alone.
CurNote is assigned n the PostOpen event of the database.(There is only 1 database involved)
Sub Postopen(Source As Notesuidocument)
Dim CurWS As New NotesUIWorkspace
Set Cursession = New NotesSession
Set CurDB = CurSession.CurrentDatabase
Set CurSource = Source
Set CurNote = CurSource.document
If CurSource.IsNewDoc Then
CurNote.InvoiceStatus = "DRAFT"
Curnote.InvoiceNumber = "- New Invoice -"
Cursource.Refresh
End If
Dim uidoc As NotesUIDocument
Set uidoc = curWS.CurrentDocument
If Curnote.InvoiceStatus(0) = "COMPLETE" Then
uidoc.EditMode = False
Else
uidoc.EditMode = True
End If
Where did you find that? In the forum? The documentation doesn’t say anything…
I’ll have to file that one away…although I learned long ago to not restrict access to the default view…it will stop a user from even getting into the db…
When a particular user executes a LotusScript agent that includes the AppendDocLink method (of the NotesRichTextItem class), the following error occurs:
“Notes error: You are not authorized to perform that operation.”
Solution
This error occurs when the user who runs the agent does not have access to the default view for the database. A report has been submitted to Lotus Quality Engineering to update the documentation so it indicates the need to have a default view when using the AppendDocLink method.
I particularly like the bit about the documentation!!