Embedded Views SelectionFormula change PostOpen

I am trying to have an area on a form for easy reference to similar forms. I was thinking of doing this with an embedded view. However, I can’t figure out how to change the SelectionFormula for the embedded view. All I really am doing is changing the SelectionFormula from “Select Form = formName” to “Select Form = formName & PartNumber = partnumberCurrentlyOnForm”. What I have currently is: Dim view As NotesView

    Dim selStr As String

    Dim pn As String

    Dim session As New NotesSession

    Dim workspace As New NotesUIWorkspace

    Dim db As NotesDatabase

    Set db = session.CurrentDatabase

    Dim doc As NotesDocument

    Set doc = workspace.CurrentDocument.Document

    Dim field As Variant

    field = doc.PartNumber

    pn = field(0)

    selStr = "SELECT Form=""PBR"" & PartNumber="""+pn+""""

   

    Set view = db.GetView("Lookup\embeddedPartLink")

    view.SelectionFormula = selStr

    Messagebox view.SelectionFormula

    Call view.Refresh

    view.AutoUpdate = True

    Call view.Refresh 

The messagebox is giving the correct select statement, but my view is not refreshing/changing.

Or is there any other way to put a list of document links or what have you on my form that is dynamically created from a field value?

Subject: don’t do that

do you really want a user to change the selection formula of a shared view???

a) he would need the rights to do that

b) what happens if 2 users are doing it at the same time???

sorry, but that’s crab.

i would propose one of the following:

  1. create a view for each form and set the embedded view to the selection

  2. create a personal folder and write an agent that places the needed docs to that folder

  3. write an agent that collects the wanted docs and create a list in a rt-body (newsletter-style)

Subject: Temporary/Dynamic View?

I wasn’t thinking a permanent change of the selection formula, but rather temporary view just for that document.

What I really want is to embed document links to all other forms that have the same part number.

I just figured a view is already a “list of document links…” I just need the view to be filtered to only show those entries that have the same partNumber as the current form has (in a field…).

Subject: Wouldn’t a single category view accomplish this?