Problem in Post Save event ---For some reason the document is not closing , I have to manually hit the escape key to close the current document---Please help

Hi All,

I am having a problem in the Post save event

When I am running the code in debugger , where my last statement Call uidoc.close —doesn’t work , my document is open and i have to manually click the escape key on the keyoward to close the document…

Please help …why do I have to manually click the Escape Key

Here is the code in the PostSave event

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim session As New NotesSession

Dim user As String

Dim AI As String

Dim ALI As String

Dim RT As String

Dim userName As New NotesName(session.UserName)

Dim memodoc As NotesDocument

Dim newdoc As NotesDocument

Dim db As NotesDatabase

Dim recipients As Variant

Set db =session.currentdatabase

Set uidoc = workspace.CurrentDocument

Set newdoc = uidoc.Document

'Set newdoc = Source.Document

user = username.Abbreviated

AI = source.FieldGetText( "claimApproverSorted" )

AIL = source.FieldGetText( "claimApprovalList_RejectedList" )

x = user 

y = Cstr(Now())



p = newdoc.claimApprovalProcessComplete(0)

RT = newdoc.claimStatus(0)

Dim q As String

q = newdoc.claimALRLImplode(0)

If Lcase$(AI) = Lcase$(AIL) And p <> "1" And q <> "" And RT <> "Draft" Then

	Set memodoc = New NotesDocument (db)

	Set rtitem = New NotesRichTextItem( memoDoc, "Body" )

	Call rtitem.AppendDocLink( newdoc, "Claim" )

	Call rtitem.AddTab( 1 )

	Call rtitem.AppendText( newdoc.claimClaimID(0))

	Call rtitem.AddNewLine( 1 )	

	Call rtitem.AppendText("Product Category:  " & newdoc.claimCategory(0))

	Call rtitem.AddNewLine( 1 )	

	Call rtitem.AppendText("Brand Name:  " & newdoc.claimBrandName(0))

	Call rtitem.AddNewLine( 1 )	

	Call rtitem.AppendText("Type of Claim:  " & newdoc.claimClaimType(0))

	recipients=newdoc.claimDBAdmin

	memoDoc.Principal = "Claims Administrator"

	memoDoc.Subject = "The Approval Process for this Claim is Complete"

	memoDoc.SendTo = recipients

	memoDoc.Send(False)

	newdoc.claimApprovalProcessComplete="1"

	Call newdoc.Save(True, True)

Else

	Call uidoc.Close

	' the code above doesn't close , I have to manuaaly click the escape Key on the keyboard



	

End If

End Sub

Please help

Thanks in advance,

ac ac

Subject: RE: Problem in Post Save event —For some reason the document is not closing , I have to manually hit the escape key to close the current document—Please help

If the problem only happens while debugging, I wouldn’t worry about it too much. Sometimes the debugger can get confused about which is the current window you’re trying to do UI operations in.