Action button not working in embedded view

Ok i am going nuts. I have an action that is an embedded view. When the action is activated in a normal view it works perfectly but in the embedded view i get nothing.

I am completely at a loss. I have other actions that work but this simple one will not. Am i completely crazy or missing something simple?

Code below…

'THIS BUTTON IS USED IN THE EMBEDDED CONTACTS VIEW THAT RESIDES IN THE CUSTOMER

'Set standards

Set Ws = New notesuiworkspace

Set Sess= New notessession

Set Db = Sess.CurrentDatabase



Set NotesDocColl = db.UnprocessedDocuments

Set NotesDoc = NotesDocColl.GetFirstDocument



While Not NotesDoc Is Nothing

	NotesDoc.Status = "INACTIVE"			

NotesDoc.StateFlag = “DELETE”

                NotesDoc.ToBeSynchronizedWithInformix = "YES"

	Call NotesDoc.Save(True,False)

	Set NotesDoc = NotesDocColl.GetnextDocument(NotesDoc)

Wend



Call Ws.ViewRefresh

Subject: Action button not working in embedded view.

It is not a good idea to get the collection from an embedded view. It is better to redesign it in a such a way that you code directly runs on the documents in a view. Not the embedded view. Very unfortunate.

Subject: Action button not working in embedded view.

Thank you both for your responses.

Narasimhan Nallani

What exactly do you mean? I have always been able to get the unprocessed documents in an embedded view. Should i have not been able to? And if not how do i grab the documents i want to alter in the embedded view?

Matt Whalley

I tried your code and i have used this before so i understand it. I get the same reaction…nothing at all occurs…

I also used your code in a non embedded view and it worked perfectly.

Does anyone else have these problems with embedded views?

As i said before i have code to do something similiar that works but for somne reason i can not for the life of me get the selected documents to be looped through and altered.

Not even the first doc in the collection gets altered.

I am at a total loss.

Thanks everyone for your help it is greatly appreciated.

Jody

Subject: Action button not working in embedded view.

boy i can tell i am looking forward to christams vacation. I made a mistake with the view and what it was showing…

So sorry for bugging folks.

Subject: Action button not working in embedded view.

Are you trying to process the selected documents in the view? If so, check out the documents property of NotesUIView.

You’d want something like this:

Dim ws As New NotesUIWorkspace

Dim uiview As NotesUIView

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument

Set uiview = ws.CurrentView

Set dc = uiview.Documents

Set doc = dc.GetFirstDocument

While Not (doc Is Nothing)

doc.Status = “INACTIVE”

doc.StateFlag = “DELETE”

doc.ToBeSynchronizedWithInformix = “YES”

Call doc.Save(True, False)

Set doc = dc.GetNextDocument (doc)

Wend