Scenario: I have a series of Action buttons called DbLinks that open summary documents in several databases. Each summary document has a single category embedded view that returns all documents pertaining to a customer based on a CustomerNumber key.
When I access this summary document in a different db, it opens fine.
When I access a summary document in the same db, it opens fine. But then, after opening a document from the embedded view, I am unable to create a response document to the newly opened document. It simply returns a new instance of the original document calling the response.
I have used the following code to create a response, save it, and then reopen. It works fine (according to the Debugger) until the last line. I am able to create the doc, it shows up as a response in the view, but when I try to open it for editing, it takes me back to the new instance of the original calling document.
Set newDoc = db.CreateDocument
newdoc.Form = “fNotes”
newDoc.Subject = “Notes Script Test”
newDoc.CustomerNumber = doc.CustomerNumber(0)
newDoc.Customer = doc.Customer(0)
newDoc.Contact = doc.Contact(0)
cd = Now
cn = doc.CustomerNumber(0)
newDoc.CreateDate = cd
Call newDoc.MakeResponse(doc)
Call newDoc.Save(True, True)
Set view = db.GetView( “NotesLU” )
key = cn+cd
Set newDoc2 = view.GetDocumentByKey( key, True )
Set uidoc2 = ws.EditDocument(False, newDoc2, False, “Subject”, True, True)
BTW - this code works fine at the top level, just not from a document opened from an embedded view.