Reg Exp
Web Design
Notes Client
@IsNewDoc Warning
If you are using the formula @IsNewDoc in any of your forms, you should be aware of the information in this tip. Often times, @IsNewDoc is used to hide some action buttons that shouldn't appear until the document has been saved. However, if a document is created through script and then opened to the user, @IsNewDoc will return @False even though the document has not been saved. For example, take this LotusScript:

Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = db.CreateDocument
doc.Form = "My Form"
Call ws.EditDocument(True, doc)

This script creates a document (does not save it) and opens it up in edit mode for the user to work with. If you put a computed for display number field on the "My Form" form with a value of @IsNewDoc, you will notice that this is @False (0) even though the document has not been saved.