Frameset/Embedded View -- save required?

I’m working on some existing code and have been tasked with trying to figure out a solution. Here’s the quick synopsis:

The user opens a contact in our CRM application. That opens a frameset in which the contact form opens up in the top frame, and in the bottom frame, we show a form with an embedded view from another database, whereby we pass the values for “Embedded Selection” and “View Single Category”.

Here’s essentially the code that performs that:

Set iDoc = New NotesDocument(thatDB)

With iDoc

  .form = "dspView"

  .dspKey = strKey

  .dspView = strView

End With

Call uiws.SetTargetFrame(“BodyView”)

Call iDoc.Save(True, False)

Set uidoc = uiws.EditDocument(True, idoc)

(the strKey and strView variables are what pass to the embedded selection and the view single category).

The thing I’m trying to figure out, if it’s possible, is why I have to save the document for it to display? If I don’t save it, it gives me an “Unable to find Document Window” error. I’ve tried ComputeWithForm…no luck…I’m guessing the hangup is that we’re passing those view values on the fly?

As it is now, it works, but it creates hundreds of these “dspView” forms daily, which we have to delete with an agent nightly. I was hoping that there might be a way to show this without the save to save us a lot of overhead.

Thanks much, and let me know if you need more info…

Subject: RE: Frameset/Embedded View – save required?

I haven’t tried to do what you’re doing, but maybe you could store the information in an environment variable or something and use Compose instead, to work around the limitation.

Subject: RE: Frameset/Embedded View – save required?

Thank you all for the advice! I’ll get to it and see if I can make any of them work.

Much thanks again!

Subject: Frameset/Embedded View – save required?

If neither Esther’s nor Andre’s suggestions work for you, rather than creating a document each time you want to compose a document, why not create a “profile-like” document for each user and recycle it each time the user creates a new document. So, you might have something like:

Dim ses as New NotesSession

Set iDoc = viewUserDocs.GetDocumentByKey(ses.UserName, True)

If iDoc is Nothing Then Set iDoc = New NotesDocument(thatDB)

With iDoc

.form = “dspView”

.dspKey = strKey

.dspView = strView

End With

Call uiws.SetTargetFrame(“BodyView”)

Call iDoc.Save(True, False)

Set uidoc = uiws.EditDocument(True, idoc)

At least this way, you don’t create those documents over and over and you don’t have a mess to clean up nightly.

Mind you, there’s a risk that if you allow the user to compose two documents at a time, the recycling of documents may interefere with this process - that’s up to you to figure that out.

Subject: Frameset/Embedded View – save required?

Note that I haven’t tried this. Maybe using a NotesUIDocument to begin with would work:

Dim uidoc As NotesUIDocument

Call uiws.SetTargetFrame(“BodyView”)

Set uidoc = uiws.ComposeDocument ( “”, “”, “dspView” )

Call uidoc.FieldSetText( “dspKey”, strKey )

Call uidoc.FieldSetText(“dspView”, strView)

Subject: RE: Frameset/Embedded View – save required?

Esther, thanks a bunch…I tried this, and for some reason, it opened the “Body View” in a separate tab and gave me an error that it couldn’t set those field values…I’ll keep digging on it…I still think you may be on to something.

Thanks!