Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


dp roul 4.May.10 12:24 PM a Web browser
Notes Client 7.0.3 All 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")

Call uidoc.FieldSetText("FirstAppReview", "Approved")
Call uidoc.FieldSetText("FirstAppDate", Cstr(Now))
Call uidoc.FieldSetText("FirstAppSignature", session.CommonUserName)
Call uidoc.Save
Call doc.Save(True, True)

'mail to the second 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")

Call uidoc.FieldSetText("SecAppReview", "Approved")
Call uidoc.FieldSetText("SecAppDate", Cstr(Now))
Call uidoc.FieldSetText("SecAppSignature", session.CommonUserName)
Call uidoc.Save
Call doc.Save(True, True)

'mail to the db admin for final approval

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








  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM Web Content Manager
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite