• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Non-existent document error?

Hi,

I have a view action to do the following things:

     Dim session As New NotesSession
     Dim dbELF As NotesDatabase    
     Dim colSelection As NotesDocumentCollection    
     Dim docForm As NotesDocument, docYTD As NotesDocument
     Dim docProfile As NotesDocument
     Dim iCount As Integer, iYear As Integer
     
     Dim acl As NotesACL
     Dim aclEntry As NotesACLEntry
     Dim found As Variant
     
     Set dbELF = session.CurrentDatabase
     Set colSelection = dbELF.UnprocessedDocuments
     Set docProfile = dbELF.GetProfileDocument("frmDBProfile","[DbAdmin]")
     Set acl = dbELF.ACL
     Set aclEntry = acl.GetEntry(session.UserName)
     
     iCount = colSelection.Count    
     If iCount = 0 Then
          Messagebox "There are no selected documents to approve.", 64, "Approve Multiple"
          Exit Sub
     End If
     
     Dim iRetVal As Integer
     iRetval = Messagebox ("Do you want to approve these selected applications?", 4+32, "Approve Multiple")
     If iRetval <> 6 Then
          Exit Sub
     End If
     
     Dim k As Integer
     Dim x As Integer
     Dim iExtended As Integer
     Dim iIgnored As Integer
     iExtended = 0
     iIgnored = 0
     If iCount > 0 Then
          Dim itemAuthors As NotesItem
          Dim nameApprover As New NotesName(session.Username)
          Dim sRouting As String
          Print Cstr(colSelection.Count)
          For k = 1 To colSelection.Count
               Print Cstr(k)              
               Dim docMail As New NotesDocument (dbELF)
               Dim rtitem As NotesRichTextItem
               docMail.Form = "Memo"              
               Set rtitem = New NotesRichTextItem(docMail, "Body" )
               Dim docHR As New NotesDocument (dbELF)
               Dim rtitemHR As New NotesRichTextItem(docHR, "Body")
               
               Set docForm = colSelection.GetNthDocument(k)                              
               Dim nameUsr As New NotesName(docForm.txtAuthor(0))
               sRouting =  docForm.txtRoutingDetails(0)
               docForm.txtUpdatedBalance  = "NO"
               Set itemAuthors = docForm.GetFirstItem("listAuthors")
               
               If docForm.txtLeaveRef(0) = "Annual" Or docForm.txtLeaveRef(0) = "Maternity" Then                                        
                    If (nameApprover.Canonical = docForm.namSubmitTo(0)) Or (nameApprover.Canonical = docForm.namSubmitCover(0)) Then                        
                         Set itemAuthors = docForm.GetFirstItem("listAuthors")          
                         If itemAuthors.Contains("[HRAdmin]") = False Then
                              Call itemAuthors.AppendToTextList("[HRAdmin]")
                         End If
                         iYear = Year(Cdat(docForm.txtFirstDate(0)))
                         Set docYTD = GetStaffConsumptionProfile(docForm.txtAuthor(0), Cstr(iYear))
                         
                         If docForm.txtStatus(0) = gcAdSubmitted Then        'LEAVE ADJUSTMENT
                              docForm.txtStatus = gcApproved
                              sRouting = sRouting & "Leave Adjustment approved by " & nameApprover.Abbreviated & " on " &  Format$(Cstr(Now),"dd mmm yyyy  hh:mm")
                              docForm.txtRoutingDetails = sRouting & Chr$(10)
                              'UPDATE STAFF CONSUMPTION PROFILE                              
                              If Not (docYTD Is Nothing) Then
                                   docYTD.iConsumed_1 = docYTD.iConsumed_1(0) - docForm.txtTotalCancel(0)
                                   If docForm.satcancel(0) <> "0" Or docForm.satcount(0) <> "" Then
                                        docYTD.sat = Cstr(Csng(docYTD.sat(0)) - Csng(docForm.satcancel(0)))
                                        docForm.Totalsatcancel = docForm.satcancel(0)
                                        docForm.satcancel = "0"
                                   End If
                                   Call docYTD.save(True, False)
                              End If
                              docForm.TotalCancelDur = docForm.TotalCancelDur(0) + docForm.txtTotalCancel(0)
                              docForm.txtTotalCancel = 0
                             
                              docMail.SendTo = docForm.txtAuthor(0)
                              docMail.CopyTo = docForm.readerlist                                                  
                              docMail.Subject = "Leave Adjustment was approved for " + docForm.txtName(0)
                              Call rtitem.AppendText("Please click on doclink to view the document. ")
                              Call rtitem.AppendDocLink (docForm, "Please click on the doclink to process the document")              
                              Call rtitem.AddNewLine( 1)              
                              Call rtitem.AppendText("Please check comments column")
                              Call docMail.Send(False)
                             
                              docHR.Form = "Memo"                        
                              docHR.SendTo = docProfile.txtProfLeaveHR
                              docHR.Subject = "FYI - Leave Adjustment was approved for " + docForm.txtName(0)
                              Call rtitemHR.AppendText("Please click on doclink to view the document. ")                              
                              Call rtitemHR.AppendDocLink (docForm, "Please click on the doclink to view the document")
                              Call docHR.Send(False)
                         Elseif docForm.txtStatus(0) = gcSubmitted Then
                              docForm.txtStatus = gcApproved
                              sRouting = sRouting & "Approved by " & nameApprover.Abbreviated & " on " &  Format$(Cstr(Now),"dd mmm yyyy  hh:mm")
                              docForm.txtRoutingDetails = sRouting & Chr$(10)                              

                              docMail.SendTo = docForm.txtAuthor(0)
                              docMail.CopyTo = docForm.readerlist                                                  
                              docMail.Subject = docForm.txtLeaveType(0) + " application was approved for " + docForm.txtName(0)
                              Call rtitem.AppendText("Please click on doclink to view the document. ")
                    'THE NON-EXISTENT DOCUMENT ERROR OCCURS AT THE BELOW LINE!!!!!      
                              Call rtitem.AppendDocLink(docForm, "")
                              Call docMail.Send(False)
                              docHR.Form = "Memo"
                              docHR.SendTo = docProfile.txtProfLeaveHR
                              docHR.Subject = "FYI - " + docForm.txtLeaveType(0) + " application was approved  for " + docForm.txtName(0)
                              Call rtitemHR.AppendText("Please click on doclink to view the document. ")                              
                              Call rtitemHR.AppendDocLink(docForm, "")
                              Call docHR.Send(False)
                         End If                                                                          
                    End If
                    End If
          Next
     End If

The above is part of my coding in the action button.
I'm the manager of this db, and when I try this button, it doesn't give the error message. However, all my users get this error. They are editors for this db.

Please look for the comment line " 'Non-existence document error occurs.....' " in the above coding. The line that causes the problem is the line below my comment.

Hope someone can give some solution!
Thanks.
0
kspuea
Asked:
kspuea
  • 4
  • 4
1 Solution
 
ghassan99Commented:
are there views in this db that are personal and saved on the desktop?
0
 
kspueaAuthor Commented:
Yes, it is a personal view that stored on the user's desktop.
Is it because of that, that's why I get this error message?

0
 
ghassan99Commented:
yes, most probably. it will not be a problem if the view is shared or stored on the server.  I suggest to create a copy of the db, and delete those view or recreate them as private but on the server, and test.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
kspueaAuthor Commented:
but how do I delete/refresh the personal views that stored on the server? Is there any way?
0
 
ghassan99Commented:
its hard actually to deal with personal views created on the server. its up to the user to delete it.
0
 
kspueaAuthor Commented:
Thanks, ghassan99!! :-)
0
 
ghassan99Commented:
it worked? it doesnt give the error message anymore?
0
 
kspueaAuthor Commented:
No, I can not allow users to store their personal views on server, because it'll be very difficult to me if I were to change the view design in future.
Anyway, I have changed it to shared view after I discussed with my users. :-)
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now