Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 59
  • Last Modified:

Modify The View Selection Criterion through a Button

I'm generating a dash board kind of report and would like to take different cuts depending upon month and fortnight - the dash board is in a Lotus Form. I would like to program the selection formula of different views used to generate the dash board. with a help of a button script. like If I click January, all 26 views selection formula should change to show only January document etc..I have taken a code from Notes help but it only works on current view - I'm not very good at scripting pls help thanks
Sub Click(Source As Button)
	Dim db As NotesDatabase
	Dim ws As New NotesUIWorkspace
	Dim uiview As NotesUIView
	Dim view As NotesView
	Dim formula As String
	formula = "SELECT (@Modified > [" & (Date - 7) & "])"
	Set view= db.Getview ("($Utilization - Americas1Total KoC-Mgr)")
	view.SelectionFormula = formula
End Sub

Open in new window

0
Prashantbhatnagar
Asked:
Prashantbhatnagar
1 Solution
 
SysExpertCommented:
You need to refresh all the views after changing the formula.

I hope this helps !
0
 
PrashantbhatnagarAuthor Commented:
When I use attached script I get object veriable not set error.
0
 
Sjef BosmanGroupware ConsultantCommented:
This is quite some Notes abuse that you're up to. Furthermore, it generates a LOT of activity on the server. I'll explain why this is not the way to restrict a view to a specific set of documents. A view in Notes is (usually) the same for everybody. A view contains data, actually, so if that data is manipulated, it will be noticed by everybody who uses that view. It can take quite some time to rebuild a view.

The better ways to make single-shot overviews of the documents in a Notes database:
- you can categorize documents, per year, per month, etc., all in a standard view
- you can use @SetViewInfo, to filter the view (might take some time to, but it doesn't change the view)
- you can use db.Search or db.FTSearch, to search a view and put the documents found in a folder, for inspection
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PrashantbhatnagarAuthor Commented:
Thanks for your advice Jef - I used @DBlookup to pull the required data from the categorized view based on Months. Its working fine with out any problem.
0
 
Sjef BosmanGroupware ConsultantCommented:
Does that mean that you removed the code above and you handle the problem differently?
0
 
PrashantbhatnagarAuthor Commented:
Yes - I used a Form to design the dashboard - I have put a Month selection field on the form - the other fields use DBlookup to select data from the categorized views based on months - I compare the value of months and pull the data in the dashboard. This is how it works...
This provides flexibility to users to see the Dashboard as per the month selected by them&.

0
 
Sjef BosmanGroupware ConsultantCommented:
Okay, so no embedded views any more. The consequence is that there might be a lot more processing involved... Sometimes, it is the only acceptable way.

Let's hope it works for you!!
0
 
EE_AutoDeleterCommented:
I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Not enough information to confirm an answer.

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Auto Deleter
0
 
Sjef BosmanGroupware ConsultantCommented:
IMHO my answer (ID: 24269730) helped the most, telling Asker that the the path taken wasn't very a promising one, at all. Up to your discretion to deal with this Question.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now