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

x
Solved

# Logic put in to a view selection

Posted on 2005-03-22
Medium Priority
205 Views
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
Question by:Jaziar
• 3
• 2

LVL 46

Expert Comment

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

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

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

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

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

## Featured Post

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
###### Suggested Courses
Course of the Month15 days, 23 hours left to enroll