?
Solved

Logic put in to a view selection

Posted on 2005-03-22
5
Medium Priority
?
203 Views
Last Modified: 2013-12-18
on a form I have a date field named RequestDate with this has the default value

@If(@IsNewDoc; @Today; RequestDate)

Can I have a view named Current Month - and it will show all documents that fall within the current month?
0
Comment
Question by:Jaziar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13605655
Sure, but the refresh-arrow for the view will always be visible.

td:= @Today;
fd:= @Adjust(td; 0; 0; -@Day(td)+1; 0; 0; 0);
ld:= @Adjust(fd; 0; 1; 0; 0; 0; 0);

Select Form="xxx" & fd<=RequestDate & RequestDate<ld
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 13605707
You will get bad performance with such a view, because any current-time based formula in a view causes the whole view to be completely rebuilt every time you use it.  the "triggers" are:
    @Now
    @Today
    @Yesterday
    @Tomorrow

You can get around this by setting the "refresh view at most onece every X hours" setting.  There are also some tricks you can use to fool Notes into not realizing the triggers are there.

Here is a formula that woudl work:
SELECT @Year(RequestDate) = @Year(@Today) & @Month(RequestDate) = @Month(@Today)

Another way around the refresh dilamna is to catgeorize the view by month, and use the "show single category" feature of embedded views to show only the category for teh current month, e.g.

Selection formul -- select everything
First column category formula: @Text(@Year(RequestDate)) + "-" + @Text(@Month(RequestDate))
Single category formula: @Text(@Year(@Today)) + "-" + @Text(@Month(@Today))
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13609637
Heh, @Year and @Month. Brilliant :)

You read the Performance book on R5? It has some sort of solution for views with one of those 4 formulas in them, I think by using a midnight agent to refresh documents or the view itself. Must be clumsy for a large database. The larger the database, the more time-consuming the view will be. If things get VERY slow, then you could consider to
- create an agent that
- opens a view with the documents sorted by RequestDate
- gets the first document of the month (ByKey)
- retrieves all documents from that month and puts them into a folder
- display that folder to the user
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 13613793
Well, here's another, relatively simple way.  Instead of @Today, you use @TextToTime("[Today]").  Has the same result, but Notes/Domino does not recognize it as a time-sensitive formula.  You can then also write an agent to refresh overnight, but sometimes that does not work, and you have to Shift-F9 once a day, or use the API call to force the complete rebuild.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13613976
That was the trick! Now I remember.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question