May 17

Lotus Notes Error Notification – Cancel

My Notes has not crashed lately but when it happens I select cancel on the dialog like this:
lotus-notes-error-notification-cancel-1
What I did not know was that there was a second screen cleverly hidden behind with another message to see if I really wanted to cancel and to never show it again.  I never noticed this before, I always kept pressing cancel.  Now I know it is there and so do you!!!
lotus-notes-error-notification-cancel-2
So I selected ‘Do not show this message again’ and selected Cancel.  The next time Notes crashed and I selected cancel and this time I clicked the check box and selected OK.  I am thinking I will never have to see this confirmation screen again, but the third time Notes crashed there it was again.  Please make this go away.
Apr 27

SnT Thursday – View Icons as Categories

I like to check how referrers are getting to this blog, so I use the view ‘Referers\All by Date’ view to monitor it. One of my frustrations about this view is that either a refer is marked as valid or invalid. Which is not totally accurate because not all invalid entries have been validated. So I added a third icon that indicates that the referrer has not been validated. The third icon helped but I still found myself wasting time looking through the documents. To speed things up I added categorization (descending order) to the indicator column and my view now looks like this:
There is only one thing wrong with this, no twisties! As you can see (second picture) I do have them set to show. Even tried using my own ‘Twistie Image’ but still no luck. When ‘Display values as icons’ is disabled the twisties appear in Notes. No matter the setting for this column the twisties always show on the web, thanks Lotus for the consistency. The column formula is very simple:
@If(Verify = 1; 82; Verify = 0; 81; 162)
Update: It seems that the view icon is the twistie because clicking on the image once expands or collapses it.
Apr 24

Edit Document Fields 6.0.0

I never thought that this tool would have such a history , but it is still saves me time every day.  I am really exited about this release because a history of the values is being kept.  This history will now be selectable in the prompt when entering a new value.  The error handling and messages have also greatly improved.   Download Edit Document 6.0.0 or if you would like to step threw the code break down and learn what is happening.

Changes
  1. Added the following new data type/actions:
    • Trim
    • Trim then Unique
  2. Added history to prompts.  All prompts that where edits are now edit combo a history of ten values will be kept.  Use ‘cFieldHistoryValues’ to set the amount of history to keep.
  3. Added prompt before updating documents to confirm what is going to happen.  Set ‘cEnableConfirmation’ constant to @False to disable this feature.  This information will always be printed to the status bar.
  4. All constants start with c, some can be customized as noted.
  5. Improved error message when validating the entered formula.
  6. Improved error message when executing the operation on a document.
  7. Added ability to continue executing the operation on all remaining documents even if an error occurs.  Each time an error occurs there is an option to stop execution.  The the failed document NoteID(s) will be shown again at the end and written to the status bar.
The 5 Simple Steps
  1. Select the document(s) to update
  2. Click your toolbar button
  3. Select the field to update
  4. Select the data type or action to be performed
  5. Select or Enter the new information (if prompted)
Limitations
  • Only 1000 documents can be updated at a time
  • All @Prompts are limited to 255, including values and text messages
  • When updating multiple documents only the documents that are selected and visible (expanded) in the view will be updated. Notes needs to be able to navigate to the document in order to update them
Apr 20

SnT Thursday – Tray It!

This is one of small but useful tools that I have been using for some time.  

allows to save precious Taskbar space for minimized windows. For each application which applies TrayIt! it creates a small icon in the System Tray. (System Tray area is located near the Clock). When application’s window is minimized this icon represents the application on the Taskbar instead of the regular “minimized rectangle”.

It is particularly useful for background tasks you typically keep running on your PC all day long like your favorite E-mail client, Real Player, etc.


Try It! has improved since my last post, it has a much nicer UI.  Even though it is only in beta , it has been very stable for me and worth the risk.  Here is the new improved list of applications running


I have circled the features that I have set.  I am always up for single clicking instead of that double stuff, except for Lotus Notes double right click!
.

For some applications like Microsoft Active Sync or Google Talk there is already a system try icon, so selecting the option not to show in the system tray just makes sense.
Feb 24

Edit Document Fields 5.1.1

Updated version of Edit Document Fields is now available. Added the following new field types:
  • Left
  • LeftBack
  • Right
  • RightBack
Corrected issue with semicolons in values or formulas.  The values and formula will convert the semicolons into #SC# since the chances of this ever being part of a string is very minimal. Download or if you would like to step threw the code break down then continue. The 5 Simple Steps
  1. Select the document(s) to update
  2. Click your toolbar button
  3. Select the field to update
  4. Select the data type or action to be performed
  5. Enter the new information (if prompted)
Limitations
  • Only 500 documents can be updated at a time
  • Field value is limited to 255 because of the @Prompt limitations
  • When updating multiple documents only the documents that are selected and visible (expanded) in the view will be updated. Notes needs to be able to navigate to the document
Feb 16

SnT Thursday – LotusScript Calls & Format Formula

Thanks Rocky for the SnT idea, and also to Vince for the SnT image. This will be two parts a show and a tell.   Tell Rocky asked everyone to use Julian’s LotusScript 2 HTML on Joe Litton’s page for those of you trying to Show or Tell some LotusScript.   Ester Storm was thinking of writing a Formula to HTML which has been around for about a year. Show Back in December Craig Schumann published a tool called LS Calls .  I liked the concept of using LS Calls to determine which variables are no longer being used, and variables are being used before they are ever set.  The only thing that I did not like is having to type the command in every time, so I took Chris Doig concept that he used for Set Template Version and applied it to LS Calls as seen in the screenshot: When editing a LotusScript Calls Configuration there will be help available just as Craig defined.  One other feature that I like is the ability to open the output in NotePad or anything else you wish. The code is very simple until I needed to have LotusScript wait for the execution of LSCalls before it tried to open the output or import the CSV.   Ken Yee came to the rescue with ‘ Can you start a program in Notes and wait for it to finish? ‘ from 1998.  There was one other gotcha, having to write the command to a batch file and executing the batch file, so if anyone has a better idea let me know. The LotusScript Calls database is not that fancy but maybe the concept storing and running command type programs from Domino.  Enjoy! Update: I lost the database in my transition to WordPress, so if anyone has it please send it to me, thanks.
Dec 22

Domino Document Locking Class 1.1

Updated version of Document Locking Class is now available.

Here is an update to the Document Locking Class:
Public Sub new(  inDoc As Variant )
Public Sub SetCurrentUser( user As String )
Public Function hasDocument()
Public Sub setDocument( inDoc As NotesDocument )
Public Sub setUIDocument( inUIDoc As NotesUIDocument )
Public Property Get toString As String
Public Property Get ShowPrompts As Boolean
Public Property Set ShowPrompts As Boolean
Public Function LockingEnabled() As Boolean
Public Function IsLockedByCurrentUser () As Boolean
Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLockedByCurrentUser ( uiDoc As NotesUIDocument ) As Boolean
Public Function LockedBy ( ) As String
Public Function IsLocked ( ) As Boolean
Public Function IsDocumentLocked ( doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLocked (uiDoc As NotesUIDocument ) As Boolean
Public Function Lock() As Boolean
Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function LockDocument (doc As NotesDocument ) As Boolean
Public Function UnLock () As Boolean
Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function UnLockDocument (doc As NotesDocument ) As Boolean


Domino Document Locking

%INCLUDE "LSCONST.LSS"
 
'/**
' * A rapper around the built-in document locking that is available in Notes/Domino 6.
' *	The purpose is to provide a better more consistant way of locking and unlocking documents.
' *	Will not lock a new document since it can not be locked.  Will only show warnings once.
' *
' *	@author	Chad Schelfhout		http://www.chadsmiley.com/
' *	@version	1.1
' */
Class DominoDocumentLocking
	Private pUser As String
	Private pDoc As NotesDocument
	Private pToString As String 
	Private pShowPrompts As Boolean
	Private pDatabase_Locking_Not_Enabled As String
	Private pDatabase_Locking_Not_Enabled_Title As String
	Private pDocument_Locked As String
	Private pDocument_Locked_Title As String
	Private pEnabled As Boolean
	Private pAlreadyLocked As Boolean
	'Flag used so user is only informed once that database locking is not enabled	
	Private pDatabasePrompted As Boolean
 
	'/**
	' * Constructor
	' */
	Public Sub new( inDoc As Variant )
		pDatabase_Locking_Not_Enabled = "Database locking has not been enabled."
		pDatabase_Locking_Not_Enabled_Title = "Locking Not Enabled"
		pDocument_Locked = "Unable to lock, currently locked by: "
		pDocument_Locked_Title = "Document Locked"
		pDatabasePrompted = False
		pAlreadyLocked = False
		pShowPrompts = True
		pToString = ""
		If Not inDoc Is Nothing Then
			If Typename( inDoc ) = "NOTESDOCUMENT" Then
				Set pDoc = inDoc
			Elseif Typename( inDoc ) = "NOTESUIDOCUMENT" Then
				Set pDoc = inDoc.Document
			End If
		End If
 
		Dim Session As New NotesSession
		pUser = Session.UserName 
		If Session.CurrentDatabase.IsDocumentLockingEnabled Then
			pEnabled = True
		Else
			pEnabled = False
		End If
	End Sub
 
	'/**
	' * Determines if the document is locked 
	' */
	Private Function HasLock ( ) As Boolean
		If pDoc Is Nothing Then
			HasLock = True
		Else
			'if there is no text then it is not locked
			HasLock = Len( pDoc.LockHolders(0) ) > 0
		End If
	End Function
 
	'/**
	' * Gets the current user
	' */
	Private Property Get CurrentUser As String
		CurrentUser = pUser
	End Property
	'/**
	' * Gets the current user
	' */
	Public Sub SetCurrentUser( user As String )
		pUser = user
	End Sub
	'/**
	' * Determines if the document is locked but the current user.
	' */
	Private Function CurrentUserHasLock( ) As Boolean
		CurrentUserHasLock = HasLock ()
		If CurrentUserHasLock Then
			If pDoc.LockHolders(0) = pUser Then
				CurrentUserHasLock = True
			Else	'Not the current user.
				CurrentUserHasLock = False
			End If
		End If
	End Function
 
	'/**
	' * Determines if a document exists
	' */
	Public Function hasDocument()
		hasDocument = Not pDoc Is Nothing
	End Function
	'/**
	' * Sets the Document
	' */
	Public Sub setDocument( inDoc As NotesDocument )
		Set pDoc = inDoc	
	End Sub
	'/**
	' * Sets the document base on the UI document
	' */
	Public Sub setUIDocument( inUIDoc As NotesUIDocument )
		If inUIDoc Is Nothing Then
			Call setDocument( inUIDoc.Document )
		End If
	End Sub
 
	'/**
	' * Returns string of any messages
	' */
	Public Property Get toString As String
		toString = pToString
	End Property
 
	'/**
	' * Returns wether prompts are displayed
	' */
	Public Property Get ShowPrompts As Boolean
		ShowPrompts = pShowPrompts
	End Property
	'/**
	' * Sets wether prompts are displayed
	' */
	Public Property Set ShowPrompts As Boolean
		pShowPrompts = ShowPrompts
	End Property
 
	'/**
	' * Determines if database locking is enabled.
	' */
	Public Function LockingEnabled() As Boolean
		If Not pEnabled Then
			If Not pDatabasePrompted Then
				pToString = pDatabase_Locking_Not_Enabled
				If showPrompts Then
					Msgbox pToString , MB_ICONSTOP , pDatabase_Locking_Not_Enabled_Title
				End If
				pDatabasePrompted = True
			End If
		End If
		LockingEnabled = pEnabled
	End Function
 
	'/**
	' * Determines if the current document is locked by the current user.
	' */
	Public Function IsLockedByCurrentUser () As Boolean
		IsLockedByCurrentUser = LockingEnabled()
		If IsLockedByCurrentUser Then
			IsLockedByCurrentUser = CurrentUserHasLock( )
		Else	'Locking not enabled
			IsLockedByCurrentUser = False
		End If
	End Function	
	'/**
	' * Determines if the document is locked but the current user.
	' */
	Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
		Call SetDocument( doc )
		IsDocumentLockedByCurrentUser = IsLockedByCurrentUser
	End Function
 
	'/**
	' * Determines if the UI document is locked but the current user.
	' */
	Public Function IsUIDocumentLockedByCurrentUser ( uiDoc As NotesUIDocument ) As Boolean
		Call setUIDocument( uiDoc )
		IsUIDocumentLockedByCurrentUser = IsLockedByCurrentUser(  )
	End Function
 
	'/**
	' * Returns who the document is locked by 
	' */
	Public Function LockedBy ( ) As String
		If hasDocument() Then
			LockedBy = pDoc.LockHolders(0)
		Else
			LockedBy = ""
		End If
	End Function
	'/**
	' * Determines if the currnet document is locked 
	' */
	Public Function IsLocked ( ) As Boolean
		isLocked = LockingEnabled()
		If isLocked Then
			isLocked = HasLock( )
		Else	'Locking is not enabled
			isLocked = False
		End If
	End Function
	'/**
	' * Determines if the the document is locked 
	' */
	Public Function IsDocumentLocked ( doc As NotesDocument ) As Boolean
		Call setDocument( doc ) 
		isDocumentLocked = IsLocked()
	End Function
	'/**
	' * Determines if the UI document is locked 
	' */
	Public Function IsUIDocumentLocked (uiDoc As NotesUIDocument ) As Boolean
		'Check to make sure that there is a document, If there is none it is a new document
		If ( uiDoc.Document Is Nothing ) Then
			IsUIDocumentLocked = False
		Else
			IsUIDocumentLocked= IsDocumentLocked( uiDoc.Document )
		End If
	End Function
 
	'/**
	' * Locks the current document
	' */
	Public Function Lock() As Boolean
		Me.Lock = LockingEnabled()
		If Me.Lock Then	'Check to make locking is enabled.
			If Not pAlreadyLocked Then	'Make sure that the document is not allready locked.
				If HasLock( ) Then
					If CurrentUserHasLock( ) Then
						'Since the current user has the document locked then we don't need to.
						pAlreadyLocked = True
						Me.Lock = True
					Else
						'Document is locked by someone else.  Let's display the name
						pToString = pDocument_Locked + pDoc.LockHolders(0)
						If showPrompts Then
							Msgbox pToString , MB_ICONSTOP, pDocument_Locked_Title 
						End If
						Me.Lock = False
					End If
				Else
					'Make sure that there is a document to lock, New documents can not be locked.
					If Not pDoc.IsNewNote Then
						Call pdoc.Lock
					End If
					pAlreadyLocked = True
					Me.Lock = True
				End If
			End If
		End If
	End Function
	'/**
	' * Locks the UI document
	' */
	Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
		Call setUIDocument( uiDoc )
		LockUIDocument = Me.Lock()
	End Function
 
	'/**
	' * Locks the document
	' */
	Public Function LockDocument (doc As NotesDocument ) As Boolean
		Call setDocument ( doc ) 
		LockDocument = Me.Lock()
	End Function
 
	'/**
	' *  Unlocks the current document
	' */
	Public Function UnLock () As Boolean
		Me.UnLock = False
		If Not pDoc Is Nothing Then
			If Not pDoc.IsNewNote Then
				If CurrentUserHasLock(  ) Then	'Only unlock if the current user has it locked.
					pDoc.UnLock
					Me.UnLock = True
				End If
			End If
		End If
	End Function
	'/**
	' *  Unlocks the UI document
	' */
	Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
		Call setUIDocument( uiDoc )
		UnLockUIDocument = Me.UnLock()
	End Function
 
	'/**
	' * Unlocks the document
	' */
	Public Function UnLockDocument (doc As NotesDocument ) As Boolean
		Call setDocument( doc )
		UnLockDocument = Me.UnLock()
	End Function
 
End Class
Nov 16

Domino Document Locking Class

Updated version of Document Locking Class is now available.

To easy the pain of working with document locking I created a class that makes life a litlle easier. Here is the list of methods:
Public Sub new()
Public Function LockingEnabled() As Boolean
Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLockedByCurrentUser (uiDoc As NotesUIDocument ) As Boolean
Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function LockDocument (doc As NotesDocument ) As Boolean
Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function UnLockDocument (doc As NotesDocument ) As Boolean
So why the class? Easy it did not want have to worry about the if the documents was new, if locking was enabled, and if the document was already locked by the user and I try to lock it again. There is not much else to the code. :) So check it out.

Domino Document Locking

%INCLUDE "LSCONST.LSS"
 
'/**
' * A rapper around the built-in document locking that is available in Domino 6.
' *	The purpose is to provide a better more consistant way of locking and unlocking documents.
' *	Will not try and lock a new document since it can not be locked.  Will only show warnings once
' *
' *	@author	Chad Schelfhout		http://www.chadsmiley.com/
' *	@version	1.0
' */
Class DominoDocumentLocking
	Private DATABASE_LOCKING_NOT_ENABLED As String
	Private DATABASE_LOCKING_NOT_ENABLED_TITLE As String
	Private DOCUMENT_LOCKED As String
	Private DOCUMENT_LOCKED_TITLE As String
	Private Enabled As Boolean
	Private AlreadyLocked As Boolean
	'Flag used so user is only informed once that database locking is not enabled	
	Private DatabasePrompted As Boolean
 
	Public Sub new()
		DATABASE_LOCKING_NOT_ENABLED = "Database locking has not been enabled, please call Support Center"
		DATABASE_LOCKING_NOT_ENABLED_TITLE = "Locking Not Enabled"
		DOCUMENT_LOCKED = "Unable to lock, currently locked by: "
		DOCUMENT_LOCKED_TITLE = "Document Locked"
		DatabasePrompted = False
		AlreadyLocked = False
		Enabled = False
	End Sub
 
	'/**
	' * Determines if database locking is enabled.
	' */
	Public Function LockingEnabled() As Boolean
		Dim Session As New NotesSession
		If session.CurrentDatabase.IsDocumentLockingEnabled Then
			Enabled = True
		Else
			Enabled = False
			If Not DatabasePrompted Then
				Msgbox DATABASE_LOCKING_NOT_ENABLED , MB_ICONSTOP , DATABASE_LOCKING_NOT_ENABLED_TITLE
				DatabasePrompted = True
			End If
		End If
		LockingEnabled = Enabled
	End Function
 
	'/**
	' * Determines if the document is locked 
	' */
	Private Function HasLock( doc As NotesDocument ) As Boolean
		'if there is no text then it is not locked
		HasLock = Len( doc.LockHolders(0) ) > 0
	End Function
 
	'/**
	' * Determines if the document is locked but the current user.
	' */
	Private Function CurrentUserHasLock( doc As NotesDocument ) As Boolean
		CurrentUserHasLock = HasLock ( doc )
		If CurrentUserHasLock Then
			If doc.LockHolders(0) = Doc.ParentDatabase.Parent.UserName Then
				CurrentUserHasLock = True
			Else	'Not the current user.
				CurrentUserHasLock = False
			End If
		End If
	End Function
 
	'/**
	' * Determines if the document is locked but the current user.
	' * This is where all the logic is
	' */
	Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
		IsDocumentLockedByCurrentUser = LockingEnabled()
		If IsDocumentLockedByCurrentUser Then
			IsDocumentLockedByCurrentUser = CurrentUserHasLock( doc )
		Else	'Locking not enabled
			IsDocumentLockedByCurrentUser = False
		End If
	End Function
 
	'/**
	' * Determines if the UI document is locked but the current user.
	' */
	Public Function IsUIDocumentLockedByCurrentUser (uiDoc As NotesUIDocument ) As Boolean
		'Check to make sure that there is a document, If there is none it is a new document
		IsUIDocumentLockedByCurrentUser = ( uiDoc.Document Is Nothing )
		If IsUIDocumentLockedByCurrentUser Then
			IsUIDocumentLockedByCurrentUser= IsDocumentLockedByCurrentUser( uiDoc.Document )
		End If
	End Function
 
	'/**
	' * Determines if the the document is locked 
	' * This is where all the logic is
	' */
	Function IsDocumentLocked (doc As NotesDocument ) As Boolean
		isDocumentLocked = LockingEnabled()
		If isDocumentLocked Then
			isDocumentLocked = HasLock( doc )
		Else	'Locking is not enabled
			isDocumentLocked = False
		End If
	End Function
 
	'/**
	' * Determines if the UI document is locked 
	' */
	Function IsUIDocumentLocked (uiDoc As NotesUIDocument ) As Boolean
		'Check to make sure that there is a document, If there is none it is a new document
		If ( uiDoc.Document Is Nothing ) Then
			IsUIDocumentLocked = False
		Else
			IsUIDocumentLocked= IsDocumentLocked( uiDoc.Document )
		End If
	End Function
 
	'/**
	' * Locks the UI document
	' */
	Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
		'Check to make sure that there is a document, If there is none it is a new document
		LockUIDocument = ( uiDoc.Document Is Nothing )
		If LockUIDocument Then
			LockUIDocument = LockDocument( uiDoc.Document )
		End If
	End Function
 
	'/**
	' * Locks the document
	' */
	Public Function LockDocument (doc As NotesDocument ) As Boolean
		LockDocument = LockingEnabled()
		If LockDocument Then	'Check to make locking is enabled.
			If Not AlreadyLocked Then	'Make sure that the document is not allready locked.
				If HasLock( doc ) Then
					If CurrentUserHasLock( doc ) Then
						'Since the current user has the document locked then we don't need to.
						AlreadyLocked = True
						LockDocument = True
					Else
						'Document is locked by someone else.  Let's display the name
						Msgbox DOCUMENT_LOCKED + doc.LockHolders(0) , MB_ICONSTOP, DOCUMENT_LOCKED_TITLE 
						LockDocument = False
					End If
				Else
					'Make sure that there is a document to lock, New documents can not be locked.
					If Not Doc.IsNewNote Then
						Call doc.Lock
					End If
					AlreadyLocked = True
					LockDocument = True
				End If
			End If
		End If
	End Function
 
	'/**
	' *  Unlocks the UI document
	' */
	Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
		UnLockUIDocument = ( uiDoc.Document Is Nothing )
		If UnLockUIDocument Then
			UnLockUIDocument = UnLockDocument( uiDoc.Document )
		End If
	End Function
 
	'/**
	' * Unlocks the document
	' */
	Public Function UnLockDocument (doc As NotesDocument ) As Boolean
		UnLockDocument = False
		If Not doc Is Nothing Then
			If Not Doc.IsNewNote Then
				If CurrentUserHasLock( doc ) Then	'Only unlock if the current user has it locked.
					doc.UnLock
					UnLockDocument = True
				End If
			End If
		End If
	End Function
 
End Class