Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Weird You are Not authorized error

Have a weird situation I just cannot figure out. Have a database which sends out training modules to sales reps. I just added a new module, a Table of contents module and had towork through some issues to get that to work. When I send any of these items from the db it works perfectly, and sends exactly what I requested, but when most of the members of my team test the db and try and send this new module, 1. it does not send it 2. it gives them a you are not autorized to perform that operation error. I do not have any security on the new form.

All the users have editor access, not delete. I bumped up one user to Mgr and he did not get the error, and he did get the module he requested. Why would going from Editor to Mgr eliminate all the issues.

The whole thing is really strange, I am completely baffled by it.

Sub Click(Source As Button)
      Dim workspace As New NotesUIWorkspace          
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim linkdoc As NotesDocument
      Dim rtitem As NotesRichTextItem
      Dim Item As NotesItem
      
      Set db = session.CurrentDatabase
      Set uidoc = workspace.CurrentDocument
      Set doc = uidoc.Document
      Call uidoc.Save
      Call doc.Save(True, True)
      Set emaildoc = db.CreateDocument
      Set emaildocb = db.CreateDocument
      
      Set Item = New NotesItem(emaildoc,"SendTo", notesnh , NAMES)
      Item.IsSummary = True  
      
      If uidoc.FieldContains( "module_met", "One" ) And module1_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module1_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  The Basics, Module 1 "
            emaildocb.SendTo = doc.user            
            doc.module1_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      If uidoc.FieldContains( "module_met", "Two" ) And module2_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module2_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  Prospecting, Module 2"
            emaildocb.SendTo = doc.user            
            doc.module2_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      If uidoc.FieldContains( "module_met", "Three" ) And module3_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module3_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  Marketing Yourself, Module 3"
            emaildocb.SendTo = doc.user            
            doc.module3_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      If uidoc.FieldContains( "module_met", "Four" ) And module4_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module4_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  The Sales Process, Module 4"
            emaildocb.SendTo = doc.user            
            doc.module4_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      If uidoc.FieldContains( "module_met", "Five" ) And module5_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module5_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  Managing Your Practice, Module 5"
            emaildocb.SendTo = doc.user            
            doc.module5_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      If uidoc.FieldContains( "module_met", "Table" ) And module6_met_flag <> "done" Then
            Set emaildocb = db.CreateDocument
            emaildocb.form = "module6_met"    '  the document you want to email
            emaildocb.Subject = "FIELD TOOLS:  Table of Contents "
            emaildocb.SendTo = doc.user            
            doc.module6_met_flag = "done"
            Call emaildocb.Send (True)
      End If
      
      Msgbox "Thank you for submitting your request.  It has been received and is being processed."
      Call uidoc.Save
      Call uidoc.close
End Sub
0
jforget1
Asked:
jforget1
  • 6
  • 2
  • 2
  • +1
2 Solutions
 
jforget1Author Commented:
This is the code that is in a editable checkbox field tied to the code above.

Module One The Basics
Module Two Prospecting
Module Three Marketing Yourself
Module Four The Sales Process
Module Five Managing Your Practice
Field Tools Table of Contents
0
 
jforget1Author Commented:
I have been looking at other stuff to provide as much info as possible.

As stated above, the users who are having an issue have Editor access, I have an Author field which is computed when composed and has @UserName as the value. I checked one of the records that gave the error and it had the user name in the Author_1 field.
0
 
SysExpertCommented:
It could be an agent restriction on the Server or in the DB.

DId you resign the DB with an D that should run any agent s ?

I hope this helps !
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jforget1Author Commented:
There are no agents used in this database at all.
0
 
cezarFCommented:
do you have form access control in the form used by CurrentDocument?
0
 
jforget1Author Commented:
I do not have any special controls on the form at all. I have my Notes administrator looking at it now, hopefully they will be able to find the reason.
0
 
cezarFCommented:
at which line of code do you get the error? it would help us better understand the problem. :)
0
 
marilyngCommented:
Set emaildocb = db.CreateDocument  << who can create documents in this database?
 emaildocb.form = "module1_met"    '  the document you want to email      << Who can edit this document
Call emaildocb.Send (True)
 

So basically, you have to turn on debugging on the user's computer, and let them step through this code to see where it stops with the error, because it's either going to be on the create document , or the send mail or the doc save.

0
 
jforget1Author Commented:
This just gets more confusing, I have had my Notes admin people look at this they were able to login as the people and he got no errors.

I have run it through debugger and appears to be giving the error on this line Call emaildocb.Send (True) but if they choose any other item, it does not give the error and it has exactly the same code.
0
 
marilyngCommented:
Set emaildoc = db.CreateDocument
Set emaildocb = db.CreateDocument  

First - get rid of one of these, you don't need to create two documents.

You code could send six email notifications, which emaildocb.send is it stopping on?   And is that one that same as the one that is being trapped?
0
 
jforget1Author Commented:
I think it is due to a corruption to these particular users. I have done some additional testing and it is not the code. I am checking with the admin people to see if there is anything they can do, I really appreciate all the help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now