@SetViewInfo--works when Db is local but not on server (on postopen within a frameset)

I have a @SetViewInfo in the PostOpen event of a view (embedded within a frameset). The view opens when the Db opens.

The filter works when the Db is local, but not when I work from the replica on the server. I get the error: “Cannot execute the specifed command” and the view opens with all documents showing.

It works if I switch to another view and reopen the original view into the same frame.

I have a button in the view with the same exact formula, and that works both locally and on the server.

I have used both @SetTargetFrame and @UpdateFormulaContext and still get the error.

The view is not collapsed when opening (which was a problem I encountered before).

I have also tried changing the filter to an empty string (to show all) but that fails too.

Does anyone know what might be going wrong?

Subject: RE: @SetViewInfo–works when Db is local but not on server (on postopen within a frameset)

That it works in a local replica but not on a server (which is maybe slower) makes me think that it has something to do with when the event executes, relative to asynchronous view opening (“Please go away and do other stuff while I work on opening this view”). I can’t reproduce your problem with the version 8.0.1 client, but maybe the event timing is different, or something about the window focus at the time the event runs.If it’s trying to execute Postopen before the view is fully open yet, I could see it getting this error. Perhaps you need to do something to prevent the async screen from coming up, as a test to see if this really the problem. There’s a preference to turn off this feature, “Disable View updates as a background task”, in the Additional Options.

There was previously some problem reported regarding focus when a frameset is being opened and one frame contains view that opens in async mode. This was supposed to be fixed in 7.0, however. I think you might take up this problem with Lotus Support.

In the meantime, for a workaround, you might try subtly different ways to run the code. For instance, put it in an agent and have the view Postopen code call the agent using @PostedCommand. Or first call an agent that uses LotusScript NotesUIView.SelectDocument to select the document that’s already selected, then try your call after the agent returns.

Or you might make the view open a lot faster and thus prevent the async from starting. You could put view Queryopen code that does a view refresh in the back end; that way, opening the view on screen should be very fast because there are no more documents to re-index.

Subject: you are already working on 8.0.1 - do you know…

…Andre, when it will be downloadable on the Passport site?

We are organizing our migration schedule - and are eager to start with it, and not with 8.0.0

Thanks,

Uwe

Subject: RE: @SetViewInfo–works when Db is local but not on server (on postopen within a frameset)

Well, I tried turning on “Disable view updates as a background task” but that didn’t seem to work (plus, some users may have this turned off).

So I created two agents.

The first used the NotesUIView.SelectDocument to select the first document.

The second agent was the @SetViewInfo.

I got an error (variable not set) when the view opened, so I added the “On error resume next” to the agent, and now everything seems to work fine.

Agent SelectFirstDoc

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim workspace As New NotesUIWorkspace

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Dim uiview As NotesUIView

On Error Resume Next



Set db = session.CurrentDatabase

Set uiview = workspace.CurrentView

Set collection = db.AllDocuments

Set doc = collection.GetFirstDocument

Call uiview.SelectDocument(doc)

End Sub