Robert Brindza 24.May.12 12:52 PM a Web browser Domino DesignerAll ReleasesAll Platforms
I need a little help.
I have a button in a view that while copy the selected document as a new document and puts the new document in edit mode. I have had no problem with this function up until recently. There is one document in the database that will error out when running the script. The error received is “Note Error: Note item not found (MCSDocs). Stepping through debug I noticed that the RTF (item) MCSDocs does not show up under the select document MCSDoc.
Here is the script I am using.
Dim ws As NotesUIWorkspace
Dim session As NotesSession
Dim dc As NotesDocumentCollection
Dim db As NotesDatabase
Dim view As NotesView
Sub Initialize
'Declare variables...
Dim answer As Integer
Dim subformDoc As NotesDocument
Dim newDoc As NotesDocument
Dim MCSDoc As NotesDocument
Dim rcode As Integer
'Used For RichText field
Dim rtMCS As NotesItem
Dim db As NotesDatabase
Dim DocCollection As NotesDocumentCollection
'Set variables...
Set Session = New NotesSession
Set db = session.CurrentDatabase
Set ws = New NotesUIWorkSpace
Set DocCollection = session.CurrentDatabase.UnprocessedDocuments
Set subformDoc = New NotesDocument( db )
'Prompt User for New Location...
rcode = ws.Dialogbox ("sfNewLocationDlg", True, True, False, False,
False, False, "New Location", subformDoc, True, False, True)
If Not rcode Then End
'Create new MCS document
Set newDoc = Db.CreateDocument
newDoc.Form = "frmMCS"
'Create fields from selected documents
Set MCSDoc = DocCollection.GetNthDocument(1)
'Set richtext item from current document
Set rtMCS = MCSDoc.GetFirstItem("MCSDocs")