6098 comments
2357 subscribers
6258 on Twitter
Subscribe! Feed reader E-mail

LotusScript: Checking another database for categories that do not contain a document of a particular type

We want to scale up Innovation Discovery and share the insights/workshop methods with more people, so one of my tasks is to remove sensitive information from our workshop output documents, post the scrubbed output documents in our community, and update the relevant sector page in our wiki.

This would be easier if people notified me after engagements, but at least we’ve gotten people into the habit of adding files to the Teamroom. I decided that instead of asking people to remember one more step in our post-engagement process, I would just regularly get into the habit of checking the Teamroom for updated documents. The Teamroom date view is useful, but there are other documents mixed into this, and I don’t think I can get my team members to adopt a consistent naming scheme or document type. However, if I wrote an agent to tell me which client categories didn’t have a final output document entry yet, I could use that to find new entries and follow up on old ones. So I did.

I didn’t have access to create new agents in the Teamroom database. I worked around this by creating this agent in my own database and then connecting to the other database from there.

Sub Initialize
	'This script looks for all the client categories that do not have a final documents entry
	'Display the current document's Categories field
	
	Dim dbID As New NotesDatabase("","dbom1\global18.nsf")
	Dim doc As NotesDocument
	Dim catView As NotesView
	Set catView = dbID.getView("CategoryLookup")
	'Determine list of clients
	Set doc = catView.Getfirstdocument()
	Dim clients List As String
	Dim finished List As String
	Do Until(doc Is Nothing)
		Dim category As String
		category = doc.Getitemvalue("Categories")(0)
		If (InStr(category, "Clients") <> 0) Then
			'This belongs in the client category. Has it been found? Add it to the list
			category = Mid(category, 9)
			clients(category) = category 
			If (doc.GetItemValue("DocType")(0) = "Final output") Then
				finished(category) = category 	
			End If 
		End if
		Set doc = catView.Getnextdocument(doc)
	Loop
	'Remove completed items
	Dim s As String
	s = ""
	ForAll client In clients
		If (Not IsElement(finished(client))) then
			s = s + client + " "
		End if
	End ForAll
	MessageBox(s)
End Sub

I change entries to the “Final output” document type after I’ve processed them. So far, so good!

Short URL: http://sachachua.com/blog/p/7218

On This Day...

  • 2011: Managing configuration changes in Drupal — One of our clients asked if we had any tips for documenting and managing Drupal configuration, modules, versions, settings, and [...]
  • 2009: Thoughts on Toodledo versus Emacs Org — It’s been a couple of months since I switched to using the Toodledo instead of Emacs Org to manage my [...]
  • 2009: Weekly review: Week ending June 7, 2009 — From last week’s plans: Relationships: Play with photography Posted new phonos. Wealth/career: Revise guide, prepare Transition2 build, give Early Career Conference presentation, [...]
  • 2009: Stage fright, visualization and improvization — “Maybe I should take a break from presenting,” I said, “and focus instead on writing blog posts and articles so [...]
  • 2008: Drupal meetup in Toronto later – 7:00 at the Drake — Instead of self-defense and yoga classes today, I’m going to the Lullabot meetup for Drupal developers over at the Drake [...]
  • 2008: Notes on backporting modules from Drupal 6 to Drupal 5 — I needed a web statistics module for a Drupal-based project at work, and integrating an external web statistics module seemed [...]
  • 2008: IBM Pass It Along – social learning! — I’m happy to share that one of my favorite Enterprise 2.0 tools within IBM is now available on the Internet. [...]
  • 2007: Week in review — Back in Canada to work on my thesis. Outlined my thesis and started panicking about timing of work. Have decided to adjust [...]
  • 2006: The Alchemist — Coelho, Paul. 1988. _The Alchemist._ p149. “From where I am,” the sun said, “I can see the Soul of the World. [...]
  • 2006: One-thought — One of my greatest joys is one-thought: immersing myself so completely in the moment, focusing my entire self on a single [...]
  • 2006: More conversations — Last night was also a spectacular evening. Kat, Mike, Shane, Simon, and I chatted over coffee for a while, then had [...]
  • 2006: Centre Island — Today I finally made it out to Centre Island, thanks to Joe Whitney. It was a wonderfully sunny day. The ferry [...]
  • 2004: “Cognitive Personal Assistant” — A computerized assistant that can schedule meetings, filter and prioritize email, and carry out other mundane administrative chores using artificial intelligence is [...]
  • 2004: Yesterday — Talked about CS21A syllabus changes with Dr. Sarmenta, who is a lot more agreeable now than before. Also, had Paolo Venegas and [...]
  • 2003: Presentation packages — - http://www.miwie.org/presentations/presentations.html
  • 2003: Cat stories — Awwww, my cat has a little bump on top of her head. Must be from all those times she hit the [...]
  • 2003: Tips — Richard A. Detweiler, Information Week, June 6, 1994 1. Think both short-term and long-term at the same time, like a CEO [...]
  • 2003: Open source course ware — - http://www.k12os.org/ - http://www.claroline.net/ - http://seul.org/edu/ - http://moodle.org

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!