Solved

Show a count of items in folder?

Posted on 2004-08-05
39
1,114 Views
Last Modified: 2013-12-18
Has anyone developed something that will allow Lotus Notes R5 to display the number of items in a folder?  For example, I want to know how many messages are in my Inbox or one of my own folders.  Can it be done?  Thanks.
0
Comment
Question by:dysert
  • 18
  • 13
  • 5
  • +2
39 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11725660
Try ^A, and look at the bottom line. Will that do?
0
 

Author Comment

by:dysert
ID: 11725730
No. What I'm looking for is something that shows me - without switching to a different view - how many items are in each of my folders.  For example, down the left side of my screen I see:
  Inbox
  Draft
  Sent
  Personal

Ideally, I'd like to see how many documents are in each:
  Inbox (23)
  Draft (2)
  Sent (17)
  Personal (7)

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11725850
Can't. Notes itself shows (in R6 anyway) the number of UNREAD mails in folders. I tried to figure out how they did it, but it's probably linked to the name $Inbox. Dirty coding...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11725887
Maybe you can try the OpenNTF mail template, it replaces (more or less) the standard Notes templates. I'm neither familiar with its features nor its quality, however.
0
 

Author Comment

by:dysert
ID: 11726000
I'd be game to try OpenNTF but I don't have it.

Thus far, I'm a mere user of Notes, but by profession I am a programmer, so if someone could point me to resources that tell me how to get started writing functions (?) that might allow me to do what I want, I would do that and post my function here.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11726089
www.openntf.org

Implementing what you want is not easy, for several reasons:
- you'd need a Domino Designer to do it.
- you need quite some Notes experience to pull it off
- the Notes client doesn't give you much freedom in this case
- changes to the mail-template should be re-applied whenever Lotus releases a new one
0
 

Author Comment

by:dysert
ID: 11726317
I appreciate your advice.  Perhaps I don't truly appreciate the magnitude of what I'm proposing, but in 25 years of programming I haven't been stumped yet.  If you're telling me it's *impossible* then I'll shut up about it.  If you're just telling me it's difficult, then all I need is a pointer to resources that will tell me how to write functions/templates/databases (whatever is the right term) and I'm game to try.

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11726474
In the standard Notes-template, you can't. If you're willing, against all odds, to modify the code, you can bring it about, but I consider the costs to be too high. And I wouldn't know a way to do it easily, for it is impossible to have programmed text in an outline. AFAIK. My gut-feeling tells me that it can be done, technically, but it's absolutely not worth trying it, anyway not my time.

Notes is programmable, very much so, and if you want to try then get (download, buy) a Domino Designer.

Maybe someone else will pick up your question. Start yourself first, and ask us when you're stuck.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 11726513
In LotusScript:
NotesDatabase.Views returns an array of views.
For each of the views you could check its property IsFolder.
When it returns True, retrieve the AllEntries property (=NotesViewEntryCollection).
This collection has a property Count.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11726615
CRAK's code will get you the counts, but it won't display it as part of the UI (nextto folder names on the left panel).  You can do this, but it is relatively high overhead.  The list of folders is in a design element called an outline.  Outlines are programmable, so you could set a refresh action that will go through all the folders (per CRAK's code), find the entry in the NotesMailOutline that matches, and change the DISPLAY NAME OF THAT ENTRY to include the doc count.  But, if you have a lot of folders, that's pretty expensive.  R6 gets around theissue by having a single API operation that retrieves all this information, so the work takes place on the server.  You would be working with script, which is not as efficient, and has to conduct transactions in a loop.  You could get the code to run on the server for efficiency, but it will still be slower.

A further problem is that the outline display does not normally refresh when the outline is changed.  You need to do a workspace refresh to redisplay it, and that's an operation that is known to be a bit buggy, especially in R5.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 11726754
Easier would be to store the names and counts in a single string variable (don't forget to add chr$(10) and/or (13) between folders for new lines) and display that in a messagebox.
Activate it through an agent or action button.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11732961
Interesting topic.

CRAK& QWALETEE,
You people proved again.

Very good.

By the above method, you will get no.of entries in each view. How about getting Unread documents?

Thanks
0
 
LVL 13

Expert Comment

by:CRAK
ID: 11733228
Sjef mentioned that too... who mentioned an unread count?
Dysert didn't! I'm glad too: I wouldn't have a clue! ;-))
0
 

Author Comment

by:dysert
ID: 11734895
CRAK's suggestion about using an agent or action button to display a messagebox seems like a good compromise.  Having done neither (remember, I'm a programmer, but I've never programmed Notes), could you please get me started?  I'll finish it and post the end result here.

Thank you!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11735495
Is this a rent-a-coder request? Then count me out! ;)

You should do this the other way round: YOU start it and WE will fix the loose ends.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11737640
Look into MsgBox/MessageBox (same as VB) and DialogBox/@DialogBox (displays a form or subform in a window).

For the former, you build your list as a string and pop up the results.

For the latter, you build the form or subform, and code to the QueryOpen to get the data, dump t into a field on the form/subform.

As to showing unread lists, you would have to use the API to get the unread collection and the view content collection, and then create a derivative collection for the intersection of the two and find its count.
0
 

Author Comment

by:dysert
ID: 11737704
Thanks, qwaletee.  That's getting closer to telling me how to start.  But since I've never programmed in Notes before, I don't even know where to begin.  I tried looking for DialogBox and MsgBox (and MessageBox) in Help and came up empty.  If someone could give me just the tiniest bit of help to tell me in general how/where one would write such a script I'd be off and running.  How about you?  Could you tell me what steps you'd go through to simply pop up a message box that says "hi"?

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11737743
You need the Domino Designer actually to be able to create/modify Notes applications. With it comes the Designer Help database, but you can also find that on the ibm/Lotus website, see www.lotus.com/ldd (?).
0
 
LVL 13

Accepted Solution

by:
CRAK earned 20 total points
ID: 11739467
Sjef.... are you in or out?

It's only a short bit of code! And besides.... do you remember your first effort? The first one is the hardest as one hasn't got much of an idea of the object structure yet...
So even if its only 20 pt for a rent-a-coder project, I think we should reach out and give dysert a hand.

Dysert,

Take the code below and put in in an agent. Set it to run (manually) from the action menu and to run on (target) "none". Don't be dissapointed by its performance: Accessing a view in a large database can be time consuming. I have added a "print" as progress-indicator.

Sub Initialize
      Dim Session As New NotesSession
      Dim Db As NotesDatabase
      Dim VwAr As Variant
      Dim Count As Integer
      Dim Vw As NotesView
      Dim Coll As NotesViewEntryCollection
      Dim Msg As String
      Dim NwLine As String
      
      Msg = ""
      NwLine = Chr$(10)
      Set Db = Session.CurrentDatabase
      VwAr = Db.Views
      For Count = 0 To Ubound(VwAr)
            Print "Accessing view " & Count + 1 " of " & Ubound(VwAr) + 1
            Set Vw = VwAr(Count)
            If Vw.IsFolder Then
                  Set Coll = Vw.AllEntries
                  Msg = Msg & Vw.Name & ": " & Coll.Count & NwLine
            End If
      Next
      If Msg <> "" Then
            Messagebox Strleftback(Msg, NwLine), MB_OK + MB_ICONINFORMATION, "Document / foler count:"
      Else
            Messagebox "No folders found.", MB_OK + MB_ICONINFORMATION, "Document / foler count:"
      End If
End Sub
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11752819
I'm definitely out!

Sjef :)
0
 

Author Comment

by:dysert
ID: 11753600
Thank you, CRAK.  I have no trouble with the code, but the trouble I have is with Notes itself.  For example, you say "to run on (target) 'none'".  What does that mean?  When I'm in the agent "editor" I see nowhere that it talks about what it's to run on, nothing about a target, and no "none".

Also, where do I enter the Sub/End Sub code?  I tried typing it into the lower box of the agent "editor" but it's apparently read only.

See what I mean?  Even after 25 years of programming, it's the tool/interface that I don't know.  Once I get past that I can write the code.

Thanks again.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11753881
See the Agent's Properties box. If you want to enter Sub etc, set the agent to use LotusScript first (it's set to Formula by default).
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11753921
One needs 3-6 months to put on the LotusScript straightjacket, but it won't feel very comfortable at first ;)
0
 

Author Comment

by:dysert
ID: 11754155
I feel like such an idiot.  I managed to find the Agent's Properties box, but nowhere in there do I see anything about running it on (target) "none".  I also don't see where I can set the agent to use LotusScript.

Straightjacket?  Feels more like an impenetrable fortress :-(
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11754422
Open the Agent, or create a new one, then get the Properties box open (Alt-Enter is fastest), at the bottom you'll see Runtime. Ah, blast, this is for R6, and you have R5. I do apologize...

Open the Agent, at the rop you'll see the name, the next line is When the agent should run, and then What the target documents will be. You can select both.
0
 

Author Comment

by:dysert
ID: 11754693
Believe it or not, I long ago did what you suggest.  I did set the "Manually From Actions Menu" for when it should run, but when I pull down the "Which document(s) should it act on" I am only presented with the following choices:
- All documents in database
- All new and modified documents since last run
- All unread documents in view
- All documents in view
- Selected documents
- Run once (@Commands may be used)

There is no "none" target.

Furthermore, I still don't know how to set the agent to use LotusScript.

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11755057
The "none" is the Run once... :-|
0
 

Author Comment

by:dysert
ID: 11755190
I greatly appreciate your patience!  Now the final hurdle (I hope!) is telling the agent I want to use LotusScript.  Do you have one more in you?

Thanks!
0
 
LVL 13

Expert Comment

by:CRAK
ID: 11756054
Thanks for filling that out Sjef! Hard to turn your back on things, isn't it?  ;-))
Sorry for not being around in day-time. My career move is getting through. Being under closer supervision in an Oracle departement, I can't spend too much time in Notes designer....
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11756254
Well, as you said, for 20 points we do a lot... You earned them already, so it's just for having some fun that I still post some comments here. Dysert should have opened a new question, the next thing he will ask is how to put a RichText item in a DialogBox or so. But there ends my dedication really.

And I have eyes in my back :) I'll take the dayshift, you'll do the nightshift??
0
 

Author Comment

by:dysert
ID: 11756959
I appreciate the time you've spent getting me over these hurdles, but I wanted you to be aware that I still do not know how to get the subprogram into Notes.  I looked at the Properties box for the agent and there's nothing there about LotusScript (or Formula for that matter).  So, unless someone wants to finish the job by telling me how I'm supposed to enter the code that CRAK posted, our conversations today - though enlightening - have had no practical value in terms of solving the problem I originally asked about :-(
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11757313
I no longer have R5 available, so I have to do this "eyes-closed". On the right-hand side, there should be three frames visible in a T-like form. The top one describes the agent's characteristics, bottom-left the events of the agent and the bottom-right one the code. If on your system the bottom two frames do not show up, pull the bottom of the frame upwards, you'll see the two frames appear. Now in the bottom-right frame, select LotusScript as the language to use, instead of formula or simple actions or whatever. Then select the Initialize event in the left frame, you'll see the Sub Initialize...End Sub appear. Dump your code in there.

Other options: read the Notes Designer Help Database, get some courseware somewhere, or take a Lotus training.

The hurdles you talk about are more or less imaginary (or just 10" high), you just need a pair of Notes-spectacles. And some time to get adjusted. Seriously, read the Designer Help db. And make a lot of mistakes, the process of learning by stumbling around. Has been my way a few years back.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11757341
I'm knackered. Bedtime over here. If others didn't pick this one up, I'll be back in 10 hours or so.
0
 

Author Comment

by:dysert
ID: 11757490
I have managed to get the "T" to appear, but the lower left corner is blank, and the lower right corner (where it says "run") has a greyed-out drop-down listbox containing the phrase "simple actions".  I have been reading the Help files, but apparently they assume a little bit of experience with the Notes paradigm.  So unless I stumble across something helpful in Help, I'm still stuck figuring out how to actually enter the LotusScript code into my agent.
0
 

Author Comment

by:dysert
ID: 11757657
Since a picture is worth 1000 words, I have posted a screen shot of what I'm up against.  Please visit the following page:
http://www.geocities.com/bd2.rm/notes.htm

Apparently I need to get the "Run" listbox enabled somehow.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11759895
It is possible that you don't have sufficient rights in the database, but since it is your own mail database, that won't be the case. I therefore assume you try to develop this in the Notes-client and not in the Designer client. You need a separate application to be able to use all the features built into Notes. Do you have this Designer client?? If not, get it somewhere, e.g. off a CD already in your position (depending on your licence etc.)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11759929
To verify whether you've got the Designer or not, go to the Workplace, click your mail database (don't open it) and click on View. If it has both menu-options Agents AND Design then you have the Designer installed. No Designer, no LotusScript. And please, re-read my comment dated 08/05/2004 06:51AM PST where I already suggested you would need the Designer. Now I think I know why you also didn't react on the Designer Help database suggestion: you just don't have it, for it comes with the Designer installation! Also, make sure you have a Designer licence.
0
 

Author Comment

by:dysert
ID: 11761973
Well that settles it. I clicked my mail database, clicked View, and sure enough only the Agents item is there - no Design :-(.  Now I've got to jump through corporate hoops to get that installed.

Thanks for all your help, and I'm sorry I wasted your time trying to help me with an application that I don't even have the tools to develop :-(.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11762114
Hoops and hurdles. Quite a circus at your place ;-)

Usually, "they" are not very fond of users modifying applications as they feel like: waste of time, waste of resources, against all standards, new templates every few months, urgent projects, no slack, you name it. I've met some hoops too... :-( All the best, be back when you convinced "them"!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now