Inadequcies of Lotus Notes views

Further to my previous post, I’d like to comment on the inadequcies of views in Lotus Notes. Why can’t you just use @Dblookup in column, and view selection formulas?

Views are almost designed to be as inflexible and useless as possible, you can use hardly any useful commands, and the ones you can use need to be hard coded.

This should be an 100% reasonable view selection formula, which would save me hours every year, but instead I have to hard-code this, which wastes hours and hours:

FIELD Audit:=Audit;

date1:=@Text(@Adjust(@Date(@Today);-1;0;0;0;0;0));

date2:=@Text(@Date(@Today));

choice:=@Prompt([OkCancelEdit]; “Select a date”; “Please select the start date you are interested in”; date1);

choice2:=@Prompt([OkCancelEdit]; “Select a date”; “Please select the end date you are interested in”; date2);

t1:=@TextToTime(choice);

t2:=@TextToTime(choice2);

alldates:=@Explode( @TextToTime(“[”+@Text(t1)+“-”+@Text(t2)+“]”));

DoesItContain:=@If(@Contains(alldates;SubmitDate);“1”;“0”);

SELECT @If(DoesItContain=“1”)

@Prompt cannot be used in views!!! Why not - it’s just about the most useful command for collecting user info!

My database is old and the last thing I want to do is have to add extra forms or pages. I should just be able to select the documents I want in a view, and the user should be able to specifiy which dates appear in it.

Instead, the only option is to hard code the dates.

Can’t they come up with a product which allows proper dynamic selection? Why are notes views so inadequate?

Subject: Inadequcies of Lotus Notes views

Andrew, It is not recommended to use time based functions such as @Today, @Now, etc. in view selection formulae as it causes the server based indexer to treat the view as needing constant updates. Notes views aren’t the most flexible design artifacts, but I believe that you could leverage other user interface elements for what you are trying to do. The first two suggestions are Notes based, the second two are examples of other things you might consider for your data if it can accomodate your target audience.

  1. Create an agent which prompts the user for a date range. Construct an ad-hoc search @Formula using NotesDatabase.Search. Drop matching documents into a folder called something like “Results[Username]” and open the folder into the Notes client at the end of the agent. When doing this, please empty the folder at the beginning of each iteration.

  2. Create an agent which prompts the user for a date range. Construct an ad-hoc search @Formula using NotesDatabase.Search. Construct a Notes document in your agent and append relevant information about your NotesDatabase.Search resultset into your “report” document

  3. Create a web form to receive date inputs and other relevant critera. Construct an ad-hoc search @Formula using NotesDatabase.Search. Print out the results as an HTML page.

  4. Create an agent which prompts the user for a date range. Construct an ad-hoc search @Formula using NotesDatabase.Search. Create a spreadsheet programmatically and output the results to a spreadsheet.

Stephen

Subject: Inadequcies of Lotus Notes views

Why are notes views so inadequate?

Because they’re indexes, not dynamically-generated query results. If you insist on thinking of a view as a dynamic query, you’re going to frustrate yourself because a hammer really does make an inadequate screwdriver, especially when there are plenty of perfectly good screwdrivers laying around.

In a relational database, indexes are used to sort and quickly search/retrieve data according to pre-defined (static) criteria, while dynamic queries, which take a while to run and return results, and for which a developer must build both the input and output UIs, are used to retrieve data using dynamic criteria.

The exact same things are true of Notes.

There are many, many posts throughout both Domino forums explaining many, many ways of achieving what you are asking, a few of which have been cited in the one other response to your post which has appeared since I started typing this. Then there’s this article published back in 1997 about building ad-hoc views which you can find by reading the FAQs page (which of course everyone does before posting). There are other ways, including programmatically changing the selection and column formulas of an existing private-on-first-use view and then opening it.