Refresh to show updated status & count

Hi ,I have database with frame that compose a document(A) when the db first open.

This document(A) show a summary of document status and count from various database.

eg:

DB A

Awaiting approver > 10

Drat > 20

DB B

Awaiting approver > 55

Drat > 36

… etc …

I have difficult to refresh document(A) to reflect the updated document status and count.

I get the document status & count by doing a lookup.

Is there any way to refresh the document(A) to always show latest status and count ?

Or i should use other method instead of form,

Any idea , Please advise me on this subject.

Thank you very much …

Subject: RE: Refresh to show updated status & count

It sounds like you need a NotesTimer object to execute some of your code every so often to refresh the information.

Subject: RE: Refresh to show updated status & count

HI Andre,I am just curious, well i just read a response at address below, Is that you ?

http://searchdomino.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid4_cid556218_tax293289,00.html?track=lg_FormLang

By the way, i found the notes timer object example in Notes Help, will try in, not sure it will help or not.

Thanks.

Subject: RE: Refresh to show updated status & count

Hi,I have try it,

However the timer itself will not refresh the doc , unless i call the uidoc.refresh …

but will this slow down the database performance ?

Thanks.

Subject: RE: Refresh to show updated status & count

Doing a task is slower than not doing it. If there is no way to get the information you need without doing the task, then you will have this slowness.

If you want to know whether there’s a faster way to get the information you want, then you will have to describe how you’re doing it now. In your case, I would probably not refresh the form, but instead use LotusScript to read the information I wanted from the views, and then assign the fields using the back-end NotesDocument. This lets you keep the databases and views open in global variables, so that you save time by not having to open them again.

Subject: RE: Refresh to show updated status & count

Hi, I have a freameset with multiple frame ,

One of the frame show a form with computed fields to lookup base on the current login user. this is for a summary on how many documents are currently pending for this user in various databases.

We actually traet this as a portal to link in multiple db, also link in our mail file display it in one of the frame, so once user log in , it may stay in the screen for the the whole working day w/o exit .

That’s why i need to refresh the content to show the letest status / document count.

Any other suggestion , or any sample db can suggest to me .

Thank you very much.

Subject: RE: Refresh to show updated status & count

My suggestion is, do not refresh the form using uidoc.Refresh. Do not refresh the form at all. You probably have a formula in your computed fields that uses @Sum(@DbLookup(…)). This is not efficient.

Instead, write a “Computed when composed” field with the following formula: “”

You could either have one of these for each database, or just have one and write all your data into that. I’m going to assume the latter.

Now, write LotusScript code to get the user’s total from a categorized view with totals. So for instance, say there are five databases you want to read from. You could define global variables:

Dim databases(0 to 4) As NotesDatabase

Dim views(0 to 4) As NotesView

Dim uidoc As NotesUIDocument

In the form’s Initialize event, you could set each of the databases and views.

Set databases(0) = New NotesDatabase(“Fromage/NatlArsenimide”, “reqs\spoopinReqs.nsf”)

Set views(0) = databases(0).GetView(“RequestsTotalByAssignee”)

Set databases(1) = New NotesDatabase(…

The RequestsTotalByAssignee should be categorized by the name of the assigned person and contain a total column showing how many requests that person has.

Then you can have a little subroutine to update the information:

Sub UpdateTotals( )

dim session as new NotesSession

Dim i%, result$, newInfo$

dim entry as NotesViewEntry

for i = 0 to ubound(views)

set entry = views(i).GetEntryByKey(session.Username, true)

if entry is nothing then

newInfo = “no requests”

else

newInfo = entry.columnvalues(1) & " requests"

end if

results = results & {

} & databases(i).title & chr$(9) & newInfo

Next

Call uidoc.Document.replaceItemValue(“yourdisplayfield”, mid$(results, 2))

End Sub

And this is what you can call both from Postopen and from your timer routine.

The above assumes that the totals column has the same column number in each of your views. If this is not true, you might want to consider adding a third array – or create a little data structure that contains the database, view, and column number, and make a single array of those.

Subject: RE: Refresh to show updated status & count

Hi Andre,Thank you very very much, i tried your suggestion , it work.

Very good, by make use of this it really help me a lot.

Thank you very much.

Subject: RE: Refresh to show updated status & count

Hi Andre,I am glad to see your reply ,

You have any sample code on this ?

I will also try to search this from forum.

Thank you very much.