dp roul 4.May.10 12:24 PM a Web browser Notes Client7.0.3All Platforms
Not always but many times when clicked a button for document, lotus notes crashes.I could see it's printing "Insufficient Memory"
After that when we launch the document we could see some of the date fields are missing the data.
Below is the code in the button.In the querysave no code is present.
Any help would be graetly appreciated.
Thanks a lot
Sub Click(Source As Button)
On Error Goto er
Dim session As New notesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
CurrentUser$ = session.CommonUserName
Dim memo As New NotesDocument(db)
Dim rtitem As Variant
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim profiledoc As NotesDocument
Set uidoc = ws.CurrentDocument
uidoc.editMode = True
Set doc = uidoc.Document
Set profiledoc = db.GetProfileDocument("DbProfile")
If CurrentUser$ = uidoc.fieldGetText("FirstAppName") And (uidoc.FieldGetText("Status") = "Under Review" Or uidoc.FieldGetText("Status") = "Re-Submit" ) Then
'check if First app comments & reasons are filled in
If uidoc.FieldGetText("FirstAppReasons") = "" Then
Messagebox("Please Enter the Approval/ Rejection Reasons")
Call uidoc.Gotofield("FirstAppReasons")
Exit Sub
End If
'update the status and do a sign & date stamp , & mail to the sec approver
Call uidoc.FieldSetText("Status","Reviewed By First Approver")
memo.Form = "memo"
memo.sendTo = doc.SecAppName(0)
memo.Subject = "A request for your approval."
Set rtitem = New NotesRichTextItem( memo, "body" )
Call rtitem.AppendText("This request has been reviewed by "+ doc.FirstAppName(0)+ ". It is now sent for your approval. Pls review.")
Call rtitem.AddNewline(1)
Call rtitem.AppendDocLink( doc, "Customer Information Request")
Call memo.send (True, memo.sendTo)
Call uidoc.Close
Elseif CurrentUser$ = uidoc.fieldGetText("SecAppName") And (uidoc.FieldGetText("Status") = "Reviewed By First Approver" Or uidoc.FieldGetText("Status") = "Re-Submit" ) Then
'update the status and do a sign & date stamp , & mail to the sec approver
Call uidoc.FieldSetText("Status","Reviewed By Second Approver")
memo.Form = "memo"
memo.sendTo = profiledoc.DBAdmin
memo.Subject = "This request has been reviewed by both the approvers."
Set rtitem = New NotesRichTextItem( memo, "body" )
Call rtitem.AppendText("This request has been reviewed by "+ doc.FirstAppName(0) + " and "+ doc.SecAppName(0) +". Pls review and Close this request.")
Call rtitem.AddNewline(1)
Call rtitem.AppendDocLink( doc, "Customer Information Request")
'Call memo.save(True, True)
Call memo.send (True, memo.sendTo)
Call uidoc.Close
End If
'just update their reviews and do a new time stamp
If CurrentUser$ = uidoc.fieldGetText("FirstAppName") And uidoc.fieldGetText("FirstAppReview") <> "" Then
Call uidoc.FieldSetText("FirstAppReview", "Approved")
Call uidoc.FieldSetText("FirstAppDate", Cstr(Now))
Call uidoc.FieldSetText("FirstAppSignature", session.CommonUserName)
Elseif CurrentUser$ = uidoc.fieldGetText("SecAppName") And uidoc.fieldGetText("FirstAppReview") <> "" Then
Call uidoc.FieldSetText("SecAppReview", "Approved")
Call uidoc.FieldSetText("SecAppDate", Cstr(Now))
Call uidoc.FieldSetText("SecAppSignature", session.CommonUserName)
End If
Call doc.Save(True, True)
Call uidoc.Close
Exit Sub
er:
Call uidoc.Close
Exit Sub
End Sub