0

I'm working in HCL Notes application. I have developed a summary view to show calculated figures to the user. Then the user clicks one of the action buttons and I open a detailed view, but for that view I setup Selection Formula on the fly so that it shows the records filtered specific to that button conditions. It was working almost fine for a few days, but now most of the time it shows some previously shown (filtered) data no matter what button the user has clicked. Means it doesn't set the Selection Formula of the view and shows the view with the old formula and it won't get back to normal condition even if they restart Notes application.

When the user is stuck in this particular condition, and they peep through the status bar it shows this message:

Document has been modified or corrupted since signed! (data).

The necessary code-snippet is as below:

*Set dtlView = db.GetView("Report_Dtl")

dtlView.SelectionFormula =formula

Call dtlView.Refresh()*

where formula is the dynamically built formula. Looks like the line

dtlView.SelectionFormula =formula

is unable to update the selection formula and then the line below generates the above error message:

Call uidb.OpenView(dtlView.Name,,False, False)

Please help!

Thanks

1 Answers1

0

For "on the fly" modification of the view selection formula your user need "Designer"- access to the database, and that is never a good idea. The help document to the function you are using is explicitly stating that this is not a good idea (emphasise of mine):

This is not a good way to display a selected set of documents for a specific user. When you use this property to change the view selection, it applies to all users of the view.

There are problems with using this method to make a view display a new selection of documents for an end user:

Do not give end-users Designer access to an application.

If it is a shared view, users will interfere with each other's searches.

The Notes® client caches design information, and there's no way to tell it to update its cache (except for outlines). Exiting and re-entering the application usually works, but it's hard to programmatically ensure the user exited the application entirely.

In addition the modification of the view selection formula can break the signature of the design element and then other errors occur.

Better use another approach:

  • Use a Folder for every user and put the selected documents in there (after doing a NotesDatabase.Search with the formula
  • Use a separate view for every user and let a server agent manipulate its selection formula with a user that has access.

For having a separate view / folder for every user you could use "Shared, Private on first use"- views (they are not easy to maintain), or any process that generates them and is able to assign every view to the users they belong to... in both cases this needs some effort, but at least it will work.

Tode
  • 11,795
  • 18
  • 34
  • Sorry for being too much late in responding, in fact I have provided my user with some work around by providing a 'clone' of the same view when the original view fails because of the mentioned issue. This somehow gives them some 'relief' at least, though i have to change the code a bit to point to the other view if this condition is reported to occur. – user1575786 Feb 22 '22 at 07:01
  • There's only one user for this view but the problem is that I have to provide filter based on the selected row and column. For each column I have provided an action button at the top, so I can make a separate view for each column. That makes it quite simple to get rid of "Document has been modified or corrupted...", BUT, I also have to provide (dynamic) filter on the plot size (determined by the selected row). There are about 14 various plot sizes. So If I choose to build views for each scenario, I have to build 14 (rows) * 9 (columns) = 126 separate views which is not a good solution. – user1575786 Feb 22 '22 at 07:04
  • Still: You continue to produce problems that arise from your broken design... redesign your feature to use a folder and you will not need hundreds of views to handle this... – Tode Feb 22 '22 at 08:16