Access Required to 'immediately' re-index a view

Hi,I have created a ‘dynamic view’, that allows users to select documents, based on their status.

This view works perfectly, every time, for me.

(My access - Person Group - manager, all roles, everything ticked (its a group, and I am in it!)

However, the user has different access and gets different results. I am able to click the button, ‘Select Status button’, the with the following results:

  1. A box appears were you can select the status you are interested in;

  2. Once you press OK, the view reflects exactly your change, i.e. documents in whatever status you wanted;

The user has different results, they have Person Group Editor Access, All roles, and everything except ‘create private agents’ and ‘create ls/java agents’ checked.

Their results:

  1. A box appears were you can select the status you are interested in;

  2. Once you press OK, nothing happens. You have to click off the view, and back on to it, in order for your changes to be reflected.

THe button’s not for me, its for the user…

Here’s the code for the button:

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim uiview As NotesUIView

Dim view As NotesView



Dim response As Variant

'Dim values As Variant

Values1=Evaluate(|"All":@DbLookup("Notes":"NoCache" ; ""; "Keywords"; "Status"; 2)|)

'Dim values2 As Variant

Values2=Evaluate(|@DbLookup("Notes":"NoCache" ; ""; "Keywords"; "All"; 2)|)



values = Values1

response = ws.Prompt (PROMPT_OKCANCELLIST, _

"Select a Status", _

"Please select the status's you would like in the view.", _

values(0), values)



Dim formula As String

If response<>"All" Then

	formula = {SELECT form = "Issue" & Status ="} + response + {"}

Else

	If response="All" Then

		formula = {SELECT form = "Issue"}

	End If

End If

Set uiview = ws.CurrentView

Set view = uiview.View

view.SelectionFormula = formula

'View.AutoUpdate = True 

Call view.Refresh

Call ws.ViewRebuild

End Sub

Any ideas for this? Is it my manager access making it work for me? Or something else is wrong maybe?

Is this post CRISPY C R I S P Y ?

Subject: Access Required to ‘immediately’ re-index a view

GND,

The view must be rebuilt (as you know because you put it in last line of your code) and I suspect that the Editor Access is insufficient for this. I know that I’ve found some oddities about Access Levels and editing shared views, but I’ve never explicitly tested the ability to rebuilt a view with varying levels of access.

When I’ve done something like this, I typically have the user somewhere other than in the view for this very reason.

I wonder if you can simply boot the user out of the view, run the code, then reopen the view? That might seamlessly accomplish what you want.

regards,

raphael

Subject: RE: Access Required to ‘immediately’ re-index a view

Thanks raphael,I have had more of a search round on here, it suggested running an agent with the ‘RunOnServer’ command.

Although, that didnt work (as I need ui commands, can’t do this on server of course!), I have created an agent with ‘Run on behalf of’ and put in the ‘signer id’, and added the ‘signer id’ to the db ACL with manager access.

That seemed to work for my user, I am hoping it is using the ‘Run on behalf of’ access to run the rebuild part, instead of the users access…

Unfortunately, then I noticed, that even the old way works for the user in development! But not in production! So, I will try and organise a ‘production test’ of the new suggested functionality…