Below is the code that is used in a ‘Call Log’ within our company’s Sales Force Automation system. The purpose of this code is to add new comments to the top of the existing comments within the log. If the field exceeds its allowed size a message is given to the user, the current log is closed out and new one is created with the user’s new comments. This worked greate in 4.6.7, however in 6.5.3 the error 4412 is not being returned. On save the document in 6.5.3 is giving the error ‘Field is too large (32K)’. I tried to trap this error in several different events to get the error code to test for but have had no luch trapping it.
Can anyone help me with the below code to make it work in 6.5.3?
Thank you :o)
Sub Click(Source As Button)
On Error 4412 Goto ProcessError
Dim newentry As String
Dim oldentries As String
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
If uidoc.FieldGetText( "CallReport" ) <> "" Then
oldentries = uidoc.FieldGetText( "ReportHistory")
newentry = Today() & " " & session.CommonUserName & " - " & uidoc.FieldGetText( "CallType") &_
" " & "Purpose of Call: " & uidoc.FieldGetText( "Subjectofcall") & " Attendees: " & uidoc.FieldGetText( "CustAttendees") &_
Chr(10) & "Call Report: " & uidoc.FieldGetText( "CallReport") & Chr(10) & String$(78, Asc("-")) & Chr(10)
Call uidoc.FieldSetText( "ReportHistory",newentry & oldentries)
Call uidoc.FieldSetText( "Subjectofcall","")
Call uidoc.FieldSetText( "CallType","")
Call uidoc.FieldSetText( "CallReport","")
Call uidoc.FieldAppendText("ListAttendees", "," & uidoc.FieldGetText( "CustAttendees"))
End If
Exit Sub
ProcessError:
Dim doc As NotesDocument
Dim parent As NotesDocument
Set doc = uidoc.Document
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Set parent = db.GetDocumentByUNID( doc.ParentDocumentUNID )
Messagebox Str(Err) & ": " & Error$ & Chr(10) & "The current log will be closed. A new one will be created with the last call report pasted in."
Call uidoc.FieldSetText("Status","Closed")
’ New 03/16/2005 --------
Call uidoc.FieldSetText( "ReportHistory", oldentries)
'--------------------------------------
Call uidoc.GoToField( "CallReport" )
Call uidoc.SelectAll
Call uidoc.Copy
Call uidoc.FieldSetText( "Subjectofcall","")
Call uidoc.FieldSetText( "CallType","")
Call uidoc.FieldSetText( "CallReport","")
Call uidoc.save
Call uidoc.Close
Set uidoc = workspace.ComposeDocument( "", "", "Call Log" )
Set doc = uidoc.Document
Call doc.MakeResponse( parent )
Call uidoc.GotoField( "CallReport" )
Call uidoc.Paste
Call uidoc.FieldSetText( "Status","")
’ Call uidoc.FieldSetText( “$Ref”,saveref)
Call uidoc.GotoField( "Subjectofcall" )
’ Messagebox Str(Err) & ": " & Error$
Exit Sub
End Sub