Create Document from Open Document

Hello All,I have a current open document (WM) that i need open and from within this document i need to run an agent (via Action Button) to create a new Document (ER). there is also 1 field (identifier) that is on both the Forms that i need to have the same data to maintain a relationship between them. when I select the Action/Agent I need the original Form to stay open and i need the new Form to open which i can then add any data and then save. I have had experience with Formula Language but not much with LS. Any help would be greatly appreciated.

Thanks and Regards,

Cleve.

This is the code that I am using but it is not working…

Sub Initialize

Dim ws As New NotesUIWorkspace

Dim s As New NotesSession

Dim db As NotesDatabase

Dim orderdoc As NotesDocument, itemdoc As NotesDocument

Dim retflg As Boolean



Set db = s.CurrentDatabase

Set WMdoc = ws.CurrentDocument.Document

Set itemdoc = db.CreateDocument



itemdoc.Form = "ER"

itemdoc.identifier = orderdoc.identifier

Call itemdoc.MakeResponse(WMdoc)

Call itemdoc.Save(True, False)

End Sub

Subject: Create Document from Open Document

All you’re missing is the following line which should be added as the last line just before ‘End Sub’…

Call ws.EditDocument(True, itemDoc, False)

This will open the new document.

Alex

Subject: RE: Create Document from Open Document

Please disregard the last Post, Problem has now been solved. The reason the Documents didnt show up was because the View Form Selection needed refreshing… Thanks again for your help Alex…Thanks & Regards,

Cleve.

Subject: RE: Create Document from Open Document

Hello Alex,Thank You Very much for the solution, it has worked perfectly. The issue I have now unfortunately is that when i save the document (ER) it dissapears. I tried using a alternate formname but this hasnt worked, any ideas??

Thanks ,

Cleve.