Lotus Notes FAQ Visit Our Sponsor!

Lotus Notes Frequently Asked Questions
(Notes 3.x)

A. Administration Tips


1. How do you get rid of inactive sessions on a server?

2. How do you convert Word files to Notes format?
3. Can Notes be attacked by Viruses?
4. How do I change or turn off the new mail tune?
5. What can be done to speed up Notes TCP/IP?
6. Can @UserName be used in Selective Replication formulas?
7. Why aren't laptop user's database designs being updated?
8. How do I set up searching for numbers and punctuation with FT Search?
9. Is Notes Year 2000 Ready?
10. What keyboard shortcuts are available in Notes?
11. How do you get rid of dead mail messages on the server?
12. What do you do about forgotten passwords?
13. Why isn't my @DbLookup background macro running properly?
14. How do you run the Compact process on a schedule?
15. How do you update a Stored Form in old documents?
16. How do you fix documents with bad ReaderNames fields?
17. How do you specify a new location for the desktop.dsk file?
18. What would change the list of servers I see in the Database Open dialog?
19. How do you periodically export a view to a text file?
20. How do you change a user's name in a user ID?
21. Why do users get notified of new mail even though they don't have any?
22. What TCP/IP port does Notes use?
23. What can be done to optimize database performance?
24. How do you make a list of all groups a person is in?
25. How do you remove Stored Forms from documents?
26. Why do new documents not show up in views after a recent server crash?
27. How do you turn off Notes crash dumps (notes.rip files)?
28. Can I set the default ACL on the N&A Book to Reader?
29. Can you keep multiple versions of Notes on the same system?
30. What programs will back up Notes databases without needing a Notes server shutdown?
31. How do you minimize Notes rollout cost?
32. How do you get rid of all the deletion stubs in a database?
33. How do make a local replica which has no documents?
34. How do you get Notes to rebuild corrupted views?
35. Who can I call to find my local reseller and licensing information?
36. Can you check for mail without leaving Notes running?
37. How do you manage ACL information across an organization?
38. Can fields be added to the N&A Book?
39. How do you make the infobox reappear if it doesn't show up?
40. How do you put a Notes Database on a CD?
41. What is involved in deploying Notes to International users?
42. How do you create a database that is usable as an address book for name lookup?
43. How do you move databases onto a different drive without the user knowing about it?
44. How do you unhide a database design?
45. How do you prevent groups from being expanded when sending mail?
46. Why does the Notes SMTP gateway reply to the wrong address of incoming Internet mail?
47. How do you generate the Notes equivalent of the Unix all group?
48. How do you shut the server down for backups?
49. What Netware address does a Notes server use?
50. How do I add additional N&A books to the address lookup dialog?
51. Are there any large-scale deployment guidelines?
52. How can you have multiple users on one workstation?
53. Can you have specific notes.ini files per user?
54. How do you change how long logs are kept in log.nsf?
55. How do you set up remote users with a local replica of a new database?
56. How do you refresh Private View designs on clients?
57. Why is a user not getting the proper roles?
58. How do you move a Domino server to new hardware?
59. What encryption is used by Notes?
60. Why is my Notes client having trouble replicating over satellite links?

B. Books and Magazines


1. Helpful Non-Notes Books
2. Lotus Notes Magazines
3. Books for Notes 3.x

C. Education and Training


1. Computer Based Training
2. Flash Cards
3. Lotus Education Helpline

D. FTP Archives


1. Notes Utilities
2. Notes Related Programs or Information

E. Internet Gateways


1. How do I publish Notes databases as Web pages?
2. Where can I get a Web browser gateway for Notes?
3. Where can I get a Usenet News(NNTP) gateway?

F. Mail Gateways


1. Is there a gateway between Notes and HP OpenMail?
2. Who sells Notes SMTP Gateways?
3. How do I keep the Lotus Mail Exchange Facility from duplicating a user in the N&A Book?

G. Mailing Lists


1. LNotes-L
2. DominoLinux
3. Oklahoma State Notes-L
4. Oklahoma State Domino-L
5. Portugese Notes Users Mailing List
6. David Stephens' Lotus Product/Event News
7. LNotes-J
8. Yahoo LNotes-L Group
9. LNotes-L on Yahoo

H. Notes Platforms


1. How many users can be placed on a Netware Notes server?

2. How do you configure Notes for OS/2 with 64MB?
3. What is the maximum IPX packet size the OS/2 server can accept?
4. How do you set up a Digiboard under OS/2?
5. Can other NLMs be run on the same server?
6. How do you change the new mail sound on a Mac?
7. How do you set up server proxying through MS Proxy Server?
8. Which file system should be used for the Notes server?
9. Does Notes use multiple processors under Solaris?
10. Which versions of Solaris are supported?
11. Why does the Lotus SMTP Gateway have problems writing files?
12. How do you set up a printer under Solaris?
13. Can the Notes be set up so the user only has to log into the network once?
14. Which platform is best for a Notes server?
15. How do you get NT to reboot automatically after the Blue Screen Of Death?
16. How do you generate a core dump for IBM to look at?
17. How do you run the server and client on the same NT machine?
18. Where can I find info on Mac-specific (not Notes-related) problems?
19. How do I install Notes as an NT Service?
20. How do you set up NetBIOS?
21. Is the Netware NLM version of the Notes server stable?
22. Why doesn't Full Text Indexing work?
23. Why can't I print to a network printer from Notes?
24. How do you back up the server automatically?
25. How do you set up the modem port for Solaris 2.x?
26. How many users can be placed on an OS/2 Notes server?
27. How do you run the Notes server in the background but still be able to control the console?
28. Do I have to install the Notes/Domino Server on Windows Server?

I. Programming Tips


1. How do you lock a document that is being edited?
2. Why don't bitmaps display properly on some systems?
3. How do you write DbLookups so they work on a local database and on the server?
4. How do you display a button next to a field only when editing?
5. How do you validate that a field has alpha characters only?
6. How do you categorize and count the number of documents created in a particular week?
7. How do you reduce database size by deleting unused fields?
8. How do you make a SmartIcon that inserts a bullet into a Rich Text Field?
9. How do you do looping in macros?
10. How do prevent people from mail bombing you with unreadable messages?
11. How do you automatically copy an ACL from a template into a new database?
12. How do you display a number field with leading zeroes?
13. Why doesn't @UserName work in public views?
14. How do I set up an automatic "I'm on Vacation" mail message?
15. How do you prevent a form from prompting to save it?
16. How do you update another form with information from the current form?
17. Can you inherit fields from parts of the same form?
18. How do you do a mail merge using info from existing documents?
19. Does Section Security work?
20. How do you generate sequential document IDs?
21. How do you make a view to use for checking for replication conflicts?
22. How do you force the value of a field to be unique?
23. How do you find the positions of a string in a text list?
24. How do you remove an element from a Textlist field?
25. How do I check whether a field has changed during an edit session?
26. How do I get the week ending date for a specific day?
27. Why does @Explode only give me the first item?
28. How do you delete Environment variables from the notes.ini file?
29. How do you prevent people from viewing with a different form and saving the result?
30. How do you send a mail message with an embedded doclink?
31. How do you sum number fields which have not been edited and initialized?
32. Is there a workaround for the bug in @IsNumber?
33. How do you select only Response documents in a view?
34. Can you make a popup calendar in Notes?
35. How do you prevent people from pasting documents into a database?
36. How do you generate a subset of list values based on the contents of another list?
37. How do you open a document in edit mode if it exists?
38. How do you create mailing labels in Notes?
39. How do you set up a database to provide a menu when it is opened?
40. Is it possible to move response documents to refer to a different parent document?
41. How do you sum a numberlist?
42. How do you insert a new line in a Rich Text field using a macro?
43. Why do images cut/pasted from Notes come out black?
44. How do you access a specific element of a multi-value field?
45. How do you track document modifications?
46. How do you track who changed a critical field?
47. How do you convert a numerical value to the equivalent written text?
48. How do I remove erased fields that keep appearing in the Add Fields window?
49. How do you retrieve a column total for a category?
50. Are Dates Calculated on the Server or Workstation?
51. How do you sort and categorize a view based on months in chronological order?
52. Can a database log the number of times each document has been accessed?
53. Can you launch a URL without using InterNotes?
54. How do you get the date for Easter of a given year?
[<a href="#NT00000E6E">55.
How much information can an @Db Function return?</a>]
56. How do you avoid error messages with DBLookup?
57. How do you find the elements which are unique to a list?
58. How do signatures and sections in a form work?
59. What does the @Db NoCache parameter do?
60. How do you generate unique document numbers?
61. How do you get all the people in a group in the N&A Book?
62. How do you log off a Notes user so you can force user revalidation?
63. How do you calculate the week number in a year of a given date?
64. How do you get the directory the current database is in?
65. How do you provide context-sensitive help for your database?
66. How do you force a user to use a button to exit a form?
67. How do you make a Computed For Display Rich Text Field?
68. How do you look up all the people in a Group?
69. How do you send mail based on whether a field is modified?
70. How do you execute DOS commands from a formula?
71. How do I calculate the number of weekdays between two date fields?
72. Can I look up Multiple Keywords using @Db functions?
73. How do you make a comma-delimited ASCII export file?
74. Can I lookup Rich Text using @Db functions?
75. How do I automatically categorize incoming mail?
76. How do you notify the author of a document when a response has been composed?
77. How can I control whether the @Db Function returns a list?
78. What tricks can you use for debugging?
79. Why doesn't my filter macro run as a background macro?
80. Can you use regular expressions for string matching?
81. Why can compose-restricted forms be composed when the database isn't open?
82. How do you create a Doclink automatically?
83. Can you implement exclusive locking across replicated databases?
84. How do you add an Internet-style signature at the bottom of your mail messages?
85. Can I look up a DocLink using @Db functions?
86. How do you remove orphan response documents?
87. In what order do @Commands execute?
88. How do you convert a time field to display as military time?
89. Can you stop the refresh view indicator for displaying if you use @Today in a view?
90. How do you prevent jagged right table edges when merging/splitting cells?

J. Web Sites


1. Companies with Notes Applications
2. Local User Groups
3. Notes Related Web Sites
4. Mirrors Sites for the Notes FAQ
5. Non-Notes Web Sites
6. What Notes Related RSS Feeds Are There?


How do you get rid of inactive sessions on a server?

On the server console, execute:

SHOW USERS DROP

This drops all inactive connections on the server. After you do that and do a regular Show Users, you will see no one or only the currently active users who are actually on the system right now. It should wipe out all the old connections, but if you do it and still see a connection with anything but 0 next to it, it's a bad or phantom session and is indicative of other problems.

How do you convert Word files to Notes format?

There is a product called Hyper*Ink (formerly called Lexstyle Publisher) from CoExtant (formerly Pantano Genesis) which can batch convert formatted Word document into hyperlinked Notes documents. Contact them at [email] sales@coextant.com.

Notes:Import Document from Pembroke International also will do this, but cannot automatically generate multiple linked Notes documents for each chapter of a Word document.


Can Notes be attacked by Viruses?

Here is a useful posting by [email] Christopher Feller:

"...Notes is an entirely different paradigm. One of the reasons viruses and attacks on internet-based systems happen so frequently, is that the initiators are anonymous. They don't have to worry about retribution or punishment. However, you don't attack a Notes server anonymously like a Firewall or FTP server. You can't even begin to touch a Notes server unless someone has created an ID for you. And as soon as an ID exists, there's an electronic trail to follow, I don't care what fields you delete.
Someone creates an anonymous mail-bomb? Fine. I'll just trace through all the servers listed in the RouteServers field to find where the initial mail came from. Then I'll check the RouteTimes/PostedDate and compare that to the Notes Log to see when it was routed through that server. Then I'll check to see who was logged in and bust them.
Worried about attacks on your N&A? Don't give anyone greater than reader access, and control the certifier tightly. Don't let just anyone create replicas/copies on the server. Also, place a mail-paste macro that does an @DocumentDelete in the N&A. (This will keep anyone from routing anything nasty to the N&A by using Mail-In database documents or by setting the mail database destination of a user in the main or secondary N&A book to be the N&A itself.) Finally, mark all documents in the
N&A as read and check the database for unread documents on a periodic basis from the local workspace. If anything new or changed is there (even if it doesn't show up in a view) you'll find it by pressing that Tab key. (For those people who are worried about a disgruntled employee making design changes to documents or forms, inherit the N&A design from an "approved" template nightly and run a nightly background macro to check for documents that have mysterious or "non-approved" form names). Oh, and don't forget to setup statistics and event reporting!

My point is simply this: due to the way Notes was designed, access is always "granted", not implicit. So, no matter what, there's always a record of activity somewhere and there always a way to deny that access.

If you have your security set up sensibly, your logging turned up to the max, and train your users to look at buttons before pressing them (highlight the button and choose Edit->Button) then you really don't have much to worry about. If you ever do encounter anything strange, you'll be able to trace it with the information contained in the offending document. Don't let panic mongers scare you away from Notes!"


How do I change or turn off the new mail tune?
To turn off the new mail tune, in the local notes.ini file, add the line:

NewMailTune=

To use a different tune, specify an appropriate .wav file after the "=".

What can be done to speed up Notes TCP/IP?

In notes.ini, make sure the following are set:

TCP_Single_Message=1
TCP=16384

The Single_Message should be automatically in all versions after 3.0. The larger TCP size will increase network performance by 40%.


Can @UserName be used in Selective Replication formulas?

@UserName will not work in selective replication formulas. Separate selective replication formulas are needed for each individual who needs to see a subset of data in a database.
It is a nightmare to maintain these separate formulas. When possible, use reader names to provide subsets of data to remote users.


Why aren't laptop user's database designs being updated?

Check that the Server is given at least designer access to the Local database. A frequent error occurs like this. The database ACL is set up this way:

Default {Editor}
LocalDomainServers {Manager}
OtherDomainServers {Editor}
Admin {Manager}

Since the Server is usually in the group LocalDomainServers, it has manager
access when being evaluated against the Server's N&A Book. The problem occurs
when the Laptop user makes a replica of the DB. On the laptop, the user has a
local N&A book which is used to resolve Group Names when evaluating the ACL
when it replicates with the Server. The Server is usually not a member of the
group LocalDomainServers in that private N&A book, therefore no design changes
are passed when the replication occurs.


How do I set up searching for numbers and punctuation with FT Search?

If you are using the default.stp file, it ignores numbers. You can create a special stp file for use with this database that includes numbers. Just remove the line:

  [0-9]+

and all numbers will index.


If you are looking for numbers in a Number field, numeric fields have to be searched for by specifying this formula in the search window (or by using a Form to search which generates this formula):

  ([SearchField]=value)

Punctuation and other special marks, except for '&', "/", ":", and "." are NOT included in the index so there is no way to search for them. You can never find "C++" no matter how you arrange your query since it isn't "text" and it is not included in the index. You'll have to use the non-indexed search function by holding down <shift> as you click on the flashlight icon. This will bring up the regular search dialog box. Type C++ in there and let it search all documents. When finished, select "Show only selected" under the View menu and you'll see all the documents that contain "C++" in them. Keep in mind the words won't be hilighted like in the FTS, but at least you can identify all the documents.


Is Notes Year 2000 Ready?

From Lotus' Knowledgebase Article#147238:

Lotus Notes is ready for the year 2000. In fact, support for the year 2000 has been part of the Notes architecture from the very beginning of its development. Therefore, all Notes releases, beginning with Release 1.0, fully support all year 2000 date functions, and no human intervention is necessary for Notes to continue functioning correctly when we move into the year 2000.

When discussing the impact of year 2000 dates in Lotus Notes, there are three areas of Notes date functionality to consider. These are:

1. Date entry.
2. Date calculations.
3. Notes server time synchronization.

Below are descriptions of each of these areas and explanations of how Notes handles each:

1. Date entry.

Since Release 1.0 of Notes, it has been possible to enter dates for the year 2000 and beyond simply by typing all four digits of the year. For example, "1 1 2000".

For all Notes releases prior to Release 4.5, if only two digits are typed in for the year, Notes assumes that the user means the date within the base century 1900. For example:

If the date entered is "1 1 20", Notes releases prior to Release 4.5 will internally store the year as "1920".

Beginning in Notes Release 4.5, if only two digits are typed in for the year and the two digits are a value between 50 and 99, then Notes will assume that the year is within the base century 1900. If the two digit year value entered is between 00 and 49, then Notes will assume that the century is base 2000. For example:

If the date entered is "1 1 97", Notes will internally store the year as "1997". If the date entered is "1 1 00", Notes will internally store the year as "2000".

This new feature in Notes Release 4.5 will allow data entry to be more intuitive for users as we move into the next millennium.

The only place where Notes does not make this assumption is with the @Date function. If you enter an @Date formula with a year as two digits, Notes assumes you mean the literal year that is entered. For example, @Date(94;3;16) will evaluate as 03 16 0094, when you probably intended @Date(1994;3;16) which will evaluate as 03 16 94. This is true in all Notes releases, including Notes Release 4.5.

2. Date calculations.

All calculations using pre- and post-year 2000 dates in Notes will execute correctly. Notes' internal TIMEDATE structure stores the dates in such a way that they can be manipulated in formulas in anyway, regardless of the year or any other part of the date.

Notes internally supports up to the year 32767 on 16-bit operating systems (limited by a 15-bit year quantity in our TIME structure), and the year 41247 on 32-bit operating systems (limited by a 24-bit Julian date quantity in our TIMEDATE structure), so it is well prepared not only for the year 2000 but for many millenniums beyond that.

3. Notes server time synchronization.

When a Notes server is started for the first time, it picks up the time from the operating system it is running on and then keeps its own time from then on until the server is brought down again. The Notes server already knows how to manage the year 2000, so it will automatically roll its time from December 31, 1999 at 11:59:59 PM to January 1, 2000 at 12:00:00 AM. The Notes server also knows how to work with leap years and daylight savings time, so both of these will also be handled correctly during the year 2000.


What keyboard shortcuts are available in Notes?

Note that these shortcuts are for Windows machines. They may be different for Macs, OS/2, or Unix systems.



From a form:
[TAB] Next unread document.
[SHIFT]+[TAB] Previous unread document.
[ENTER] Next document.
[BACKSPACE] Previous document.
[Shift]+[F9] Replaces a user-entered formula in an editable text field with its returned value.
[ALT]+[1] Click the 1st action button, 2 for second, and so on.
[CTRL]+Compose Document Suppresses inheritance when creating new document.





From a view:
[RIGHT ARROW] Hortizontal Scroll Bar.
[INS] Toggles "read" and "unread" marks.
[ALT]+[number N] Click the Nth action button.
[F3] Displays or moves highlight to next selected document.
[Shift+F3] Displays or moves highlight to previous selected document.
[F9] Update current view.
[CTRL]+[SHIFT]+[F9] Update all views in database.
[Shift+Gray Plus] Expand an entire view (Expand All).
[Shift+Gray Minus] Collapse an entire view (Collapse All).
* key on the keypad Expands all descendants of the currently selected document.





From the Workspace:
[`] "Scan for unread mail" from the desktop.
[TAB] "Scan for unread" from the desktop.
[CTRL]+[SHIFT]+Double-Click on Database Shows all views of database (including the hidden ones).
[SHIFT]+Select Databases and then Double-Click Opens up the current view of all the databases into one mixed view.
[SHIFT]+View\ShowServerNames Display the filenames of the databases on the desktop.
[Shift+F9] Updates unread count on current work page.






From anywhere:
[CTRL]+[TAB] Cycles through open Notes windows.
[ALT]+[ENTER] Toggles the Properties Box.
[CTRL]+[M] Create mail Memo.
[ALT]+[F9] Minimize Notes.
[CTRL]+[F9] Restore open Notes windows to non-minimized.
[F5] Log you off of your Notes server, but does not exit Notes.
[F1] Displays context-sensitive Help.


How do you get rid of dead mail messages on the server?
Add the server database called MAIL.BOX to the Notes desktop, and open the database. Select the view for showing dead messages. You can then resend the mail messages or delete them

What do you do about forgotten passwords?

There are a couple of methods to deal with this depending on how secure you'd like user accounts to be:
1) Keep a backup of the user ID with a known password in a secure location. However, any encryption keys that the user adds will be lost if this backup file is used when the user forgets his/her password.
2) Don't keep backups and warn the user about what it means to lose a password (all your encrypted files won't be accessible any more, etc.). This also guarantees that the user is the only one who could have sent a mail message (useful in court cases) or done something to a database.
3) Separate the ID file storage and the password knowledge between two different people. This is a safer position than (1). However, if the two people work together, security in Notes can still be compromised.

If you are running 4.1, there is a new feature that will help you use method (1). You can set up an escrow account and when you register a new user, the new ID is sent (mailed) automatically to the escrow agent. This way, you keep backup copies of every ID you make.

There is no way to recover encryption keys from a user ID with a forgotten password!


Why isn't my @DbLookup background macro running properly?

For any @DbLookup or @DbColumn that is run from a backgound macro, you need to put the ReplicaID of the database where the macro is being run into the ACL of the database which is being used for the source of the lookup.

A background macro is executed by $Chronos which doesn't have an ID by itself. That's why it uses the replica ID of the database containing the macro for authentication.

How do you run the Compact process on a schedule?

Here is an example program document you can use. Make sure the Notes directory is in your system PATH.

Basics
Program name: $COMPACT.EXE
Command line: -S 5
Server to run on: ServerName/Domain
Comments: Compact databases with more than 5 percent whitespace.

Schedule
Enabled/disabled: ENABLED
Run at times: 10:10 PM each day
Repeat interval of: 0 minutes
Days of week: Wed, Sat


Note that if you are running DAOS in Domino 8.x+, you'll have to add the -B flag for the database to shrink free space properly.

How do you update a Stored Form in old documents?

First, delete the stored form in these documents by using this technique.
Then, run Tools\RefreshFields on all the affected documents.


How do you fix documents with bad ReaderNames fields?

If you access the database locally on the server, you can reset all the bad ReaderNames fields by using an agent. ReaderNames fields are only enforced when you access the database from the server. This also applies to AuthorNames.


[<a name="NT00000B02">
How do you specify a new location for the desktop.dsk file?</a>]

You can add a line to the NOTES.INI file telling Notes where to find the DESKTOP.DSK file. By default it looks in the Notes Data Directory. E.g., the following line :

  DESKTOP=C:\NEWDIR\DESKTOP.DSK

will look for the desktop.dsk file in c:\newdir.


What would change the list of servers I see in the Database Open dialog?

The databases which are listed in the File-Open dialog are all the servers which are in the same Network as your home server. So either you have changed your home server or your administrator has changed some of the servers which were in your network.


How do you periodically export a view to a text file?
This can be done with a Notes add-on called ZMerge. An evaluation version is available from Granite Software.

How do you change a user's name in a user ID?
Have the user do a Mail/User ID/Request New Name and type in the new name they want. The request comes to you, who then certifies the new name, they get it back and accept it. They can do a normal Tools/UserID/Change Name function but that will wipe out any certificates they hold and you have to recertify them.

Why do users get notified of new mail even though they don't have any?
The database compaction process on the server will cause the new mail flag to be set incorrectly. Turn this off and the false new mail signals should stop.

If the new mail notification indicator stays on, the NewMailSeqNum=X variable in the Notes.ini file also may have gotten out of sync with the server. Shut down Notes, erase the "X" part of the variable and then restart Notes.


What TCP/IP port does Notes use?

Port 1352


What can be done to optimize database performance?

1. Don't have too many views - each time you change/add a document Notes will need to update every appropriate view.

2. Keep views simple - more columns means more calculation. It gets worse if the columns are sorted and worse still if the columns are categorized.

3. Don't use @Today or @Now in selection formulas - the views will never be up to date and the server will be forever recalculating them. If you need to use today's date in a selection formula then have a background macro running each day to set an environment variable in the server's notes.ini and reference this.

4. If you want to display compound information in a view column from multiple fields then calculate it in a hidden document field. The column should then reference this single field rather than carrying out the calculation.

5. To avoid the @DBColumns/@DBLookups used to generate keyword lists, etc.,
being generated at read time use something like:

@If(@IsDocBeingLoaded & !@IsNewDoc; @Unavailable; @DbColumn(""; ""; "By _Category (Main View)"))

for the formula. Editing documents will take just as long but document readers will notice a big improvement. The example above is from a keyword format formula.

6. Use column numbers not field names for lookups

7. If you are doing lots of lookups to multiple columns in a single view then append all of the data in a single column with a unique delimiter string and do a single lookup. The value returned can then be parsed with @Left/@Right/@Mid or @Explode to give you the separate field values.

8. Put 64 Mb of RAM in the server and push the buffer pool sizes to their limits. This is documented in the Knowledge Base.

An IBM Redbook is also available: Performance Considerations for Domino Applications.

A developerWorks article is also available: Troubleshooting Application Performance

How do you make a list of all groups a person is in?

Create view in the NAB with a selection formula of "Select (Form = "Group").
Add the field 'Members' in first column.
In the propeties box for the first column, select sorting type 'categorized' and select 'show multiple values as separate entries'.
In the second column, put the field 'ListName'.

This is not recursive, so it won't show a person in a nested group.


An alternative way (from chowell@epd.renold.com) is to:
1) Load the Name & Address Book D/Base and select the "Groups" view
2) Enable the Search Bar (View, Search Bar) - the NAB has to be full text indexed
3) Key in the name of the person you are seeking - the Groups of which they are a member are identified in the view
or use the search string:

  FIELD Members contains "username or groupname" 

so you avoid false hits on the ListOwner and LocalAdmin fields.

And another way using the Notes API from agorlenko@manu.com but this only works on R5+:


Declare Function NSFBuildNamesList Lib "NNOTES" Alias "NSFBuildNamesList" _
( Byval S As String, Byval F As Long, hNL As Long) As Integer

Declare Function OSLockObject Lib "NNOTES" Alias "OSLockObject" _
( Byval H As Long) As Long

Declare Sub OSUnlockObject Lib "NNOTES" Alias "OSUnlockObject" _
( Byval H As Long)

Declare Function OSMemFree Lib "NNOTES" Alias "OSMemFree" _
( Byval Handle As Long) As Integer

Declare Function ReadInteger Lib "MSVCRT" Alias "memcpy" _
( N As Integer, Byval P As Long, Byval B As Long) As Long

Declare Function ReadString Lib "MSVCRT" Alias "memcpy" _
( Byval S As String, Byval P As Long, Byval B As Long) As Long

Sub Initialize
        Dim session As New NotesSession
 
        Dim x As String
        Dim m As String
        Dim p As Integer
        Dim I As Integer
        Dim n As Integer
        Dim hNL As Long
        Dim GroupCount List As Integer
        Dim a As String
        Dim abook As NotesDatabase
        Dim aview As NotesView
        Dim doc As NotesDocument
        On Error Goto oops
        Set abook = session.GetDatabase("", "names.nsf")
        Set aview = abook.GetView("People")
        Set doc = aview.GetFirstDocument
        Do Until doc Is Nothing
 
 
                a = doc.FullName(0) 
 
         ' Get Names List handle (fails on R4)
 
                'On Error Resume Next
                NSFBuildNamesList a$, 0, hNL
                'On Error Goto 0
                If hNL = 0 Then
                        Print "Failed"
                        Exit Sub
                End If
 
  ' Get memory pointer
                Dim pNL As Long
                pNL = OSLockObject(hNL)
 
  ' Get number of entries, skip to first entry
                ReadInteger n%, pNL, 2
                pNL = pNL + 14
 
  ' Read the entries
                For i% = 1 To n%
                        x$ = String$(256, " ")
                        ReadString x$, pNL, 256
                        p% = Instr(x$, Chr$(0))
                        pNL = pNL + p%
                        If Not p% = 0 Then x$ = Left$(x$, p% - 1)

  ' each group is listed in x$ in this loop

                Next
 
  ' Discard the Names List
                OSUnlockObject hNL
                OSMemFree hNL
                'Exit Do
                Set doc=aview.GetNextDocument(doc)
        Loop

Exit Sub


How do you remove Stored Forms from documents?

Create a macro with the following code:

SELECT $TITLE="Form Name";
FIELD $TITLE:=@DeleteField;
FIELD $INFO:=@DeleteField;
FIELD $WINDOWTITLE:=@DeleteField;
FIELD $BODY:=@DeleteField;
FIELD FORM:="Form Name";

Once the macro is run, perform Tools, Refresh Fields to update the documents with the new form attributes.


Why do new documents not show up in views after a recent server crash?

Running UPDALL -R should fix these views. However, this doesn't work all the time.

When a server crashes, views that were marked for re-indexing and were queued for UPDATE tend to not be re-indexed. That can be a lot of views. Apparently they think they're indexed and don't mark themselves to be indexed again.

Tell anyone who thinks something hasn't been updated to do a SHIFT-F9 while in the view that seems affected (not from their workspace).


How do you turn off Notes crash dumps (notes.rip files)?

Disable Quincy (the crash dump program) by renaming the executable, QNC.EXE in the Notes directory. You can also uninstall Quincy using the command line "qnc -u".


Can I set the default ACL on the N&A Book to Reader?
Notes has been designed to have the default ACL set to Author with no create or delete privileges. Without this, people cannot edit the items in their person document like phone number, location, signature, picture, etc. They also cannot delete the ID file from the N&A book after installation. And worst of all, they cannot edit any groups that they have been given ownership of. You should make the default ACL set to Author (with both delete and create turned off).

Can you keep multiple versions of Notes on the same system?

Yes. On an install of a new version, you should:
1) Put the \Notes directory in your PATH.
2) For major revisions (3.x -> 4.x -> 5.x, etc.), keep a separate copy of the \Notes\Data directory because the Notes internal database format changes between each version; new major versions will upgrade old database versions to the latest which can then no longer be read by the old versions. You can point to the appropriate data directory by editing your notes.ini file; you will only need one per major revision (NoteData.3, NoteData.4, etc.)
3) After the install, move the notes.ini file into the \Notes directory.
4) Before installing a new version, rename the directory of the old version to something else (e.g., \Notes to \Notes.463).
5) Install into the same non-renamed directory (e.g., \Notes), but before doing this, copy your desktop.dsk file into this directory so it can be upgraded if needed.

To use a specific version:
1) Make sure you are not running anything from \Notes (e.g., Notes Single Logon which is nsl.exe, the mail check in R5, the Notes client, etc.)
2) Rename the current \Notes directory to whatever version (e.g., \Notes to \Notes.463) it was.
3) Rename the directory with the version you want to \Notes (e.g., \Notes.50 to \Notes).
4) Start Notes.

You have to keep the same directory structure because in later versions of Notes, there is information in the registry related to OLE automation. If you use separate directories for each version, OLE automation may not function correctly.

With the caveat about OLE automation, you can run multiple versions simultaneously if you:
1) do not put the \Notes directory in your PATH
2) run the nlnotes.exe (or the appropriate executable for your platform be replacing the first character in the filename) instead of running notes.exe
From Olivér Zsigmond (Oliver_Zsigmond@lotus.com) comes this tip on how to run the R5 server locally with multiple clients:

Rename dirs of your existing versions of Notes R3, R4.x as described above.
Move your NOTES.INI into the appropriate NOTES.EXE dir.
Modify the Directory line in NOTES.INI to show the appropriate DATA dir.

Install Domino R5 to \lotus\domino
Install Notes R5 All Clients to \lotus\notes

Both directories will have their own NOTES.INI file and DATA dir.

Start Domino server and complete the setup.
Start any of the Notes clients (R3,R4 or R5) from its directory and you can use the local R5 server. You can stop the client and start any other one without stopping the server. The new rules are that you can start only one client and you can't start the client from \lotus\domino because if you stop this client, it will stop the Domino server as well.
Because of Windows Logo requirements, the \data directory structure in R6 is more confusing. There are some files in \lotus\notes\data underneath where you installed the main \lotus\notes executables, but there are also NSF files and the notes.ini file in "\winnt\profiles\<username>\local settings\application data\lotus\notes\data". You can change to a similiar structure as R3/R4/R5 by moving the files and then changing the Directory attribute in the notes.ini to point to the new directory.

In the registry, you should update the DATADIR value in the "HKEY_USERS\<userid>\Software\Lotus\Notes\Installer" key to point to the data directory you used so that the installer knows how to uninstall and update your current files.
In addition, the following two keys should point to the data directory:
"HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\6.0\DataPath"
"HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\DataPath"

Note that this will probably break R6's roaming user support. Installing multiple versions of Notes is something usually done by developers, so this should be a reasonable caveat.
Mike Kemp (MikeJKemp@aol.com) uses this technique for running multiple simultaneous versions on NT/Win2K:

So I could respond quickly to user's 'phone queries I had my desktop 'admin' workstation set up so I could run several Notes clients concurrently.� The OS had to be NT (or W2K) - definitely not W9x.� The set up is along the same lines as in your article, with the difference that the start-up shortcut preferences point to the appropriate nlnotes.exe (rather than the more usual notes.exe) similar to this:

for R4.5 client :-� C:\NotesR45\nlnotes.exe =D:\NotesR45\Data\notes.ini

for R4.6 client :-� C:\NotesR46\nlnotes.exe =D:\NotesR46\Data\notes.ini

for R5.x client (my main admin tool):- C:\R5Client\Notes.exe =D:\R5Client\Data\notes.ini.

and even (as an experiment):- C:\NotesR33\_lnotes.exe =D:\Notes33\Data\notes.ini.

Note that the R5 shortcut pointed to the Notes.exe and MUST be started first.

With this structure in place I could <Alt>+<Tab> between the various clients at will and so be able to 'talk my callers' through a problem quite rapidly.� I could also check the operation of a database development intended for the environment.

The only drawback was the occasional entire machine 'lock-up' if I tried to use the Admin console in more than one client at a time - but this did not affect the servers.

I have not had the opportunity yet to try out this procedure involving ND6.


What programs will back up Notes databases without needing a Notes server shutdown?

* Cheyenne ArcServe has a Notes agent which lets it back up open databases. The agent requires a "work area" of the size of your largest Notes database because it creates a replica of a database into a separate directory before backing up that database.
* Tivoli TSM (formerly IBM's ADSM) will back up open files and can back up databases incrementally.
* Veritas's Backup Exec with the Open File Option (they also have a Domino agent).
* Quadratec's Time Navigator can do full and incremental backups
* Unix's tar (and ports of it to other platforms like NT and OS/2) will back up open files.


How do you minimize Notes rollout cost?
If your application is just an information publication application, look at the Notes to Web publishing programs and the Domino support built into Notes 4.5. This approach will also allow your Notes information to be published to all Internet/Intranet users. More information on these programs can be found here.

If you just want to use the Notes applications which are bundled with Notes Express (now known as Notes Mail), using Notes Express from Lotus will let you deploy Notes for approximately $50 per seat in quantities. Any custom applications that use the Lotus API directly can also be run from Notes Express.

If you wish to develop custom applications, but not allow most users to develop applications, Notes Desktop is a run-time version which available for $79 per seat in quantities.

Finally, if your users will always be using web browsers and POP3 clients, user licenses are only $30.

The latest pricing information is
here.


How do you get rid of all the deletion stubs in a database?

All document deletion stubs in a database can be purged by selecting File/Database/Information/Replication and setting the cutoff date ahead two days. Once this is done, the deletion stubs are purged immediately.

NOTE: Depending upon the Notes platform, it may also be necessary to set the purge interval to one day as well as setting the cutoff date ahead. This is not required for all Notes platforms.


How do make a local replica which has no documents?

This is used if a user only wants to compose new documents on the local replica, but the user does not want to replicate a copy of the entire database locally.

Enter a selective replication formula which is never true:

1) Create a new replica and select initialize at first replication
2) Go to your new stub and enter the following selective replication formula:

 SELECT @False

(This will only work if you absolutly don't need anything from the original database, if you need some documents to perform lookups against, than you should only select those documents)
3) Replicate the stub, select receive from server only.
4) Clear the selective replication formula in the local database.


How do you get Notes to rebuild corrupted views?

From the server window, run:

load updall dbname -C
load updall dbname -R

Dbname is optional. If omitted it will operate on all db's.
-C builds indexes for all views that have not already been built.
-R rebuilds indexes for all views that have already been built.


Who can I call to find my local reseller and licensing information?

You can call Lotus at 1-800-782-7876 in the United States.


Can you check for mail without leaving Notes running?

These are freeware utilities that let you do this in Windows.

CMS Mail Monitor
This program shows the mail sender and lets you enter a selection formula for which mail will trigger popups. It is available [ftp] here.

Alert!
There is also a non-free Professional version which is able to monitor any database on any server you like and shows the number of unreads of each database in a window. The demo version is available [ftp] here.

Mail Monitor
This is not a freeware utility. It is available from Rein&McBride.

NotesAlarm
This is freeware, but only runs on Win95. It is available from Polo Sardinaloil's web page.

WinBiff
This is shareware and is available from the WinBiff home page.

Notify for Notes
Checks for new mail, alarms, and allows you to create new messages. From AW Soft.


How do you manage ACL information across an organization?

Notes R4 allows you to set a database's properties so that ACL's are consistent across all replicas.
Notes R5 has built in tools for updating the ACL's across multiple databases.

Percussion Software has a product called Server Admin Plus that will also let you manage and audit ACL information.

Candle also has a system administration tool.

IVES Technologies has a product called ACL Reporter Updater which is a platform independent administration tool that provides security management for enterprise-wide Lotus Notes/Domino networks.


Can fields be added to the N&A Book?

There's no problem with adding fields and views, but don't change anything that is pre-existing. Do all your work in a template, and be very careful with the management of that template. There are two dangers:
(a) losing your modified template due to inadvertant replication from a newly installed server that has a standard NAMES.NTF that is newer than your custome version, and
(b) having two different templates for the NAB on different servers such that $DESIGN on each server re-inherits conflicting designs every night causing a "Design Storm" that can bring your whole network down.

Do not name it NAMES.NTF, or it may be overwritten by a software upgrade. Make sure that the template name is not the default (StdNotesAddressBoook). You can either make it a replica of the original NAMES.NTF, or a copy.

If it is a replica, be sure to remove the original, be sure to let it replicate to all servers, and be especially sure that any time a new Notes version is loaded that you merge any changes in the new version's NAMES.NTF into your template and then delete that NAMES.NTF from your server before you allow the upgraded server to replicate with any other server.

If it is a copy instead of a replica, it is best that you uncheck the setting that allows replication of the template name for your NAB and make sure that only one server in your organization is set up to inherit the NAB design from your modified template.
Just for insurance it might be a good idea to use the ACL or selective replication to insure that your main hub server never accepts NAB design changes from any other server.

For Notes R4 and R5, the preferred way of adding fields to the NAB is to use subforms.


How do you make the infobox reappear if it doesn't show up?

From Lawrence Wagner (lwagn2@dwp.ci.la.ca.us):

METHOD #1:

Using the keyboard:

1. Select File, Database Properties.
2. Hold down the ALT key and press the spacebar.
3. If a menu appears, select Move. If not, type the letter "m".
4. Use the arrow keys (i.e., the up arrow) on the keyboard to move the InfoBox back onto the screen. You should eventually see a dotted line in the form of a rectangle. Once you do, press ENTER. The InfoBox will reappear on the screen.

METHOD #2:

The NOTES.INI variable that is responsible for the position of the InfoBox on the screen is:

Win32InfoboxPos=

If you cannot find the InfoBox, modifying the values in the NOTES.INI to will also make it reappear. The values in this parameter refer to x, y coordinate locations. By changing these to numbers that fit within the pixel resolution (for example, 800x600), the InfoBox will reappear. Examples:

Win32InfoboxPos=441 79

or
Win32InfoboxPos=333 261


How do you put a Notes Database on a CD?

From Glenn.Thibert@thehartford.com:

The following steps are necessary to put a database onto a CD or other read-only media:

1. Select the database and choose Design - Views and make sure that all views are unhidden (i.e. do not have parentheses around their names). It is important to temporarily unhide the hidden views so that the view indexes for these views can be created (see Step 2 below).

2. Open the database and press CTRL+SHIFT+F9. This key combination will rebuild all of the views in the database. This includes both open and hidden views, as well as server-based or local databases. It is important to build the view indexes before copying the database to the CD or other read-only media as, if they are not created and stored in the NSF file prior to adding it
to the read-only media, Notes will attempt to create them and will not be able to because it cannot write to the media.

Note: If a view is not built, pressing CTRL+SHIFT+F9 will cause Notes to build the view. If the view is already built, pressing CTRL+SHIFT+F9 will cause Notes to update the view, not rebuild it.

3. Create the full-text index for the database if you intend for the database to be queried using Notes' full-text indexing capabilities. You can do this using the File - Full Text Search - Create Index command. This index must be created prior to putting the database on the read-only media for the same reason described for view indexes in Step 2 above.

Note: Most CD mounting software conforms to the ISO 9660 standard which does not allow for periods in directory names. When creating full-text indexes in Notes, it by default creates a directory with the extension .FT (period - FT) which is against the ISO 9660 regulations. For example, if your database is called DATABASE.NSF, then Notes will create a subdirectory called \DATABASE.FT underneath the directory which contains the file DATABASE.NSF.

To workaround this issue, do the following

a. Create another directory which has the same name as the database, but with no extension (i.e. \DATABASE instead of DATABASE.FT). This new directory name must be the same as the database name.

b. Copy all of the files created for the full-text index from the original directory into the new directory.

c. Delete the full-text index files from the old directory name (the name with the .FT extension) and remove the directory from the system.

Notes will now see the new directory and use the full-text index files inside of it. It does not require the .FT extension to be on the directory name. The .FT is only used as a naming convention when creating the directory for full-text indexes so that those directory names wouldn't show up along with the other directory names in the File - Open Database dialog box.

4. Do an operating system level copy (such as using the DOS or OS/2 COPY command) of the .NSF file from the writeable media which you are currently using onto the media which will be used to press the CD or other read-only media. Be sure that you do an operating system level copy during this step and not a File - Database - Copy from within Notes as using Notes to copy the
database will remove the view indexes.


Also, be aware that Notes databases on a CD can only be viewed by the same major version of Notes that the Notes database was indexed with. The view index and full text index are improved with each major version, i.e., R5 can't read R4 DB on CD, etc. To work around this with old CDs you may still want to view, you can copy the .nsf file to your local system, follow the procedure above, then copy all the files onto a new CDR because CDRW drives are so inexpensive now.


What is involved in deploying Notes to International users?

From a posting by [email] Kevin Urbanek:

"There are some questions you will need to answer before a decision can be made. First the legal stuff. Legally, a NA ID file can not leave the US or Canada (unless the US State Dept grants you an exception). NA Notes servers can talk to Non-NA Notes servers just fine with one exception, encrypion keys (all keys would need to be International for them to be used worldwide). Note that not all countries allow encrypted data or have rules/laws governing encryption.

Some questions:
1. Do your applications and/or users use encryption regurally? BTW: make sure to check out encryption laws in the different countries (France,Russia South Korea and others have laws governing encryption and the keys)
2. Do your users travel internationally? (i.e a NA Notes ID travels to Europe)

If you want to keep your NA setup that you currently have, when you setup the International users/servers, you will need to create a new Organizational certifier that is International. Even though you can create an International ID from a NA certifier, this International ID still carries enough of the NA encryption info (I do not know exactly what part) to make it illegal to export. So, you would end up with 2 Organizational certifiers, which means you need to cross certify the organizations. You can still use one Domain if you wanted. Depending on number of users, you may want to look at 2 Domains, one NA and one International.

If you answered "Yes" to the above questions, then you might want to think about migrating to World Wide Security (International version) or appy to the US State Dept. for an exemption. If you look to migrating, make sure you plan the migration of IDs and also review the Notes applications you have for encyption and sections. If you keep the naming conventions you have in place, Reader and Author names should not be a problem."


How do you create a database that is usable as an address book for name lookup?
You only need to have the views ($Users), ($PeopleGroupsFlat), and ($PeopleGroupsHier) in your database. You also need the ($NamesFieldLookup) view if you want people to be able to begin typing the name in the To: field and have Notes find it automatically in the address books and fill in the rest.

In the person form, you must include the following fields:

  FirstName (Type: Text)
  LastName (Type: Text)
  FullName (Type: Names)
  MailAdress (Type: Text)
  Type (Type: Text) with default value "Person"

Then add the database to the notes.ini file as a cascaded address book.


How do you move databases onto a different drive without the user knowing about it?

You can use a directory link to put all the databases into what the user sees as a subdirectory in the Notes client. In the Notes data directory, create a file named <subdir>.dir where <subdir> is the name of your subdirectory. The first line in the file is a directory name which can include a drive letter (e.g., "e:\data2"). Lines after the first line are hierarchical names for people that can go through this directory link ("e.g., */MyCompany") so you can use directory links as a security tool.

You can also use a database link. To do this, move the database to your new directory. In the Notes directory where the database used to be, create a file with the same filename as the old database. In this file, put the path to the new location of the database (e.g., "e:\data\db.nsf"). When Notes accesses this file, it will automatically look for the database using the path you specify.

If you are using OS/2, you can install the Toronto Virtual File System (TVFS) from one of the many OS/2 ftp archives. This file system allows you to merge directories and files into a "virtual" directory that you can then use for the Notes data directory.

Note that all of these methods will slow down file access a little, but the slowdown should be negligible.


How do you unhide a database design?
There are a lot of ways to do this in Notes 3.x, but here are a few:

1) If you have multiple servers, copy the database from one server to another. This will unhide the design in the new copy. The database will still show as hidden, so change the name to a template file(ntf) and create a new database from this template. This will insure the database is truly unhidden.

2) Make the locked database a design template. Create a new database. New database inherits design from template. Refresh design from template.

3) Modify a byte in the .nsf file; this is typically done to hack an application that was sold, so this technique will not be described here.

Lotus provides a database Hide Design tool (implemented in Notes 4.x and 5.x) that secures the database design more thoroughly. It is not possible to unhide a database design in these later versions of Notes without the original unhidden template; i.e., you can't unhide it by modifying a few bytes in the .nsf file. In addition, if the original design included LotusScript files from the file system when an agent or design element was saved, you'll need these files in the right directories to modify the corresponding agent or design element.


How do you prevent groups from being expanded when sending mail?

The group expansion only happens for groups in your personal NAB. You can do the following to disable this expansion when sending mail:

Modify your memo form to include a hidden field named "ExpandPersonalGroups" with Text type and Computed when Composed with a value of "0". This will cause personal groups to NOT be expanded. Changing the value to "1" will cause the groups to expand.


The other solution is to use group alias names, but this technique only works in R3.x. For example, if you have a group named Managers make it Mgrs;Managers instead. Aliases are not expanded. That way, if you want it to NOT expand send the memo to Managers. If you DO want it to expand them, send it to Mgrs.


Why does the Notes SMTP gateway reply to the wrong address of incoming Internet mail?
Unix has traditionally had a From field and a separate Reply-To field. Notes only has a From field. Because of this, the Notes SMTP gateway uses only the From field from the Unix mail headers of incoming mail instead of using the Reply-To field.

How do you generate the Notes equivalent of the Unix all group?
Create a macro in the public N&A book that updates the group document all using a @dbcolumn on the People view of the N&A book. This macro can be run as a background macro daily. The lookup part of the macro looks like:

PeopleList := @DbColumn("";"";"People";1);
Field Members := PeopleList;

How do you shut the server down for backups?

If you are running Notes as an NT service, look at this FAQ instead.

You can use the following command to tell the Notes server to shut down:
notes server -quit
After your backup is complete, issue this command to restart the Notes server:
notes server


What Netware address does a Notes server use?

When using SPX, the server advertises with a SAP (Service Advertising Protocol) address of hex 039B.


How do I add additional N&A books to the address lookup dialog?
In your notes.ini file, you should modify the line that reads "Names=NAMES.NSF" to read "Names=NAMES.NSF,MYNAMES.NSF". This will cause Notes to look up names in both the NAMES and MYNAMES N&A books.

Are there any large-scale deployment guidelines?
For large-scale Notes deployment, standards should be defined for:
* Notes network topology & replication strategy
* Hardware and software configurations
* Hardware and software installation guidelines
* User, group, and server naming scheme
* Notes mail integration strategy
* Notes & non-Notes data integration strategy
* Server management guidelines
* Operations guidelines
* Security and ACL guidelines
* Application design guidelines
* Application implementation guidelines
* Training guidelines
* Support guidelines
* Staffing requirements
* Group naming standards
* ACL standards
* Database location standards
* Establishing test, development and production environments
* Name and Address Book control
* Centralization or distributed ID creation
* Replication strategy


How can you have multiple users on one workstation?

Each user has to have a separate notes.ini file and desktop.dsk file. There is a freeware utility called SmartSwitcher that does all this for you and provides a nice user interface. It can be picked up by clicking [ftp] here. This only works for Notes 3.x

A few settings (like workspace textured background) are not preserved for Notes 4.x users in SmartSwitcher. There is a commercial utility named MultiUser Logon Utility from Rein&McBride that does handle Notes 4.x.

Another commercial utility that reads the ID files from a database is SwitchID from Sollazzo Consulting.

You can also use location documents in Notes 4.x and higher. Important caveats: 1) users share the same desktop so one user can rearrange icons/bookmarks and totally confuse the other users, 2) they will get false "you have new mail" indications, and 3) the user ID files for all the users will be in one location.

Here are some tips from Laurence Wagner (lwagn2@dwp.ci.la.ca.us) on how to do this:


Do a normal install for the first user, then do the following:
1. Change the User Preferences
Select File / Tools / User Preferences from the menu.
In the Navigator panel, with icons labeled "Basics, International, Mail, and Ports", click on Basics.
There are four check boxes to the immediate right of the Basics icon. Select the box labeled "Prompt for location".
Now when Notes is re-started, it will prompt the user to select a named location document. The original location documents given with Notes are named for a variety of network connections that these users will not need to use, but do not delete them.

2. Copying the Notes ID files to the Workstation
Get these files from your Notes admin. These can go to the Notes\Data directory or a network drive, as long as it will be available to your users. Once on the workstation, each person should log in and reset their password from the default value. This can be done after the location documents are created for each person.

3. Add an action button, labeled "Make Location Doc", to the People view of the LADWP Name and Address Book. Switch to the user's ID file before you run this. The code for the button is as follows:

Sub Click(Source As Button)
  Dim session As New Notessession
  Dim notesdirectory As String
  notesdirectory = session.GetEnvironmentString( "Directory", True)
  Dim keyfilename As String
  keyfilename = session.GetEnvironmentString( "KeyFilename" , True)
  Dim whois As String, realwho As String
  Dim workspace As New NotesUIWorkspace
  Dim doc As NotesUIDocument
  Dim uidoc As NotesUIDocument
  Set uidoc = workspace.EditDocument(False)
  Dim item As NotesItem
  Dim first As String, last As String, mailserver As String, mailfile As String
  Dim mailserver1 As String, mailfile1 As String
  Dim short As String
  Dim short1 As String
  Dim udir As String
  Dim full As String
  Dim ppass As String
  Dim thisdb As NotesDatabase

  whois = session.CommonUserName
  realwho = session.UserName
  Set thisdb = session.CurrentDatabase
  Set uidoc = workspace.EditDocument(False)
  first = uidoc.FieldGetText("FirstName")
  last = uidoc.FieldGetText("LastName")
  short = uidoc.FieldGetText("ShortName")
  mailfile = uidoc.FieldGetText("MailFile")
  spaceposition = Instr(1,mailfile, "\")
  short = Mid( mailfile, spaceposition + 1)
  mailfile1 = "mail\\" + short
  mailserver = uidoc.FieldGetText("MailServer")
  If first <> "" Then
    full = first + " " + last
  Else
    full = last
  End If
  Call uidoc.Close
  Print "got Person data"

'  Build new rec
'
  Set uidoc = workspace.ComposeDocument ( "", "names.nsf", "Location" )
  Call uidoc.FieldSetText("Name",full)
  udir = notesdirectory
  short1 = keyfilename
  Call uidoc.FieldSetText("Userid", udir + "\" + short1)
  Call uidoc.FieldSetText("Domain","LADWP")
  Call uidoc.FieldSetText("DST","1")
  Call uidoc.FieldSetText("Enabled","0")
  Call uidoc.FieldSetText("NameLookupPref","2")
  Call uidoc.FieldSetText("ExhaustiveNameLookup","1")
  Call uidoc.FieldSetText("Images","0")
  Call uidoc.FieldSetText("LocationType","0")
  Call uidoc.FieldSetText("MailFile", mailfile)
  Call uidoc.FieldSetText("MailServer", mailserver)
  Call uidoc.FieldSetText("Source","*")
  Call uidoc.FieldSetText("TimeZone","8")
  Call uidoc.FieldSetText("WebRetriever","Netscape Navigator")
  Call uidoc.Save
  Call uidoc.Close
'
'     Add the mail database to the workspace
'
  If whois = full Then
    spaceposition = Instr(1, mailserver, "/")
    If spaceposition = 0 Then
      spaceposition = 30
    End If
    mailserver1 = Left$( mailserver, spaceposition - 1)
    Call workspace.AddDatabase( mailserver1 , mailfile1 )
    Messagebox "the mail database for: " & full & Chr(10)  & " has been added to the workspace, and " & Chr(10) & "Location
Document added to Address Book"
  Else
    Messagebox "Location Document for: " & full & " added to Personal Address Book"
  End If
End Sub

A company called DNI Systems makes a workstation sharing solution called Notes Profiler. It accomodates roaming users.

Note that this is no longer necessary as of Notes 6.01. Notes 6.01 supports roaming users so their Notes desktops go with them to each machine. It also supports multiuser installs of the Notes client on a single machine so each logged on user doesn't have to install their own separate copy of Notes and waste disk space.

Can you have specific notes.ini files per user?

You can modify your Notes startup icon to use this as the command line:

  <path>notes.exe =<path>notes.ini

This uses the specified notes.ini file. You can then place this with a user's personal data files on a file server.


How do you change how long logs are kept in log.nsf?

There is a LOG= setting in the NOTES.INI. You specify
LOG=<logfile name>,<logging enable>, 0,<days to keep documents>,<document size>

Do not set document size too large or the server will not be able to compact the log database very well.


How do you set up remote users with a local replica of a new database?

Create a mail message to the remote users with
1) a copy of the database as an attachment
2) a database doclink

Also in this mail message, add some instructions on how to detach the attachment and where to place it (in the Notes data directory). After the attachment has been detached, the instructions should ask the user to click on the doclink. This will search for the database replica locally and open it; it will also place the database on the replication workspace page.
If the attachment is large, you should warn remote users that you are sending it to them so they don't think that the replication is hung.


How do you refresh Private View designs on clients?

Delete the database icon from the user's workspace and re-add it. Deleting the database will cause all the Private Views to be removed. When the user re-opens the database, new Private Views (with the updated design) will be created.

You can do this via a macro that is sent to users via email:

@Command([WindowWorkspace]);
@Command([FileOpenDatabase];........);
@Command([FileCloseWindow]);
@PostedCommand([EditClear]);
@PostedCommand([FileOpenDatabase];.......)


Why is a user not getting the proper roles?

From Barry Wand (bwand@us.ibm.com):

The user is in an ACL as a member of a Group that has Editor access to a database and has been included in a Role that is authorized to modify a field in a Controlled Access Section. The user is also listed explicitly with Designer access. The user still cannot edit that field although other people in the same group can.

Explicit ACL entries always override Group document entries. If your Group entry has the Role assigned but your explicit entry does not then you do not have the Role assigned to you. In this case you have Designer access but without the Role assigned. You will need to adjust the ACL to assign that Role to your explicit entry also.


How do you move a Domino server to new hardware?

From colin.brown@advanticastoner.com:

The following procedure can be used when you need to move an existing Domino server to new hardware (i.e. when upgrading to a new server) without any disruption to your users. The procedure is based on a number of postings to notes.net and our own recent experience moving a R5.05 Domino server to new hardware. The basic idea is simple: install the same version of the server on the new box (but don't configure it), then move the data directory & ini file from the old machine.


1. If possible, obtain the install media for the release of Domino currently running on the server you want to move - lets call it DEV1. If this is unavailable, upgrade DEV1 to the version you DO have available. It is vital that you install the release of Domino currently running on the old machine on the new hardware. If you only have the install media for 5.07, and DEV1 is currently running 5.05, you must upgrade DEV1 to 5.07 prior to the move.

Note: It is preferable to avoid upgrading the server prior to moving it, if possible - that way you can be sure that any problems encountered after the move are not due to problems with the upgrade.

2. If the server is one of several in a Notes Domain, replicate the Domino Directory (names.nsf) with another server in the domain to ensure an up to date copy.

3. Disable replication and access to the old server (to ensure we get a frozen snapshot of the server and its data). Replication and access via Notes clients can be disabled by simply taking the Domino server down. On an NT box, as an extra precaution you can remove any shares and stop the netlogon service (this must be restarted before data can be copied to the new box).

4. Do a full backup of the old server.

5. Install Domino on the new hardware, but don't configure it.

6. Copy the data directory and the notes.ini file from the old server to the new box, replacing the data directory & ini file created during the Domino install on the new machine (if you stopped the netlogon service in step 3. you'll need to restart it so you can connect to the new server). (Note: If you have any 3rd party Domino software installed on your server, you may also need some DLLs from the program directory; it safest to just reinstall the 3rd party software)

7. If the path of the data directory on the new machine is different to the old, you need to modify the directory= line in the notes.ini file to specify the correct location of the data directory on the new machine.

8. Disconnect the old box from the network.

9. Update the DNS to resolve the server name "DEV1" to the IP address of the new server (the NT server name doesn't need to be the same as the old machine). (Note: If you're using NetBIOS for name resolution, you also have to purge the NetBIOS cache or the other machines will not find the new machine)

10. Bring the new server up, test Notes and the DNS change

11. Do a full backup of the new server

12. If you need to reconnect the old machine to the network, make sure you trash the Domino server installation prior to reconnection to prevent conflicts with the new server.

13. You're done - your server should now run happily on the new hardware with no disruption to your users.


What encryption is used by Notes?

From stharris@sd.synetics.com:

- 630 bit RSA key for Notes protocols
- 1024 bit RSA key in the web protocols (SSL and S/MIME)
- 128 bit encryption (SSL and S/MIME)
- 64 bit encryption in the Notes protocols (mail, doc encryption, session encryption, etc)

Technote 179624 - "Overview of Recent Changes in U.S. Export Regulations and Implications to
Lotus and Its Customers"

Technote 179031 -"U.S. Government Relaxed Export Restrictions"

Milestones in Notes/Domino security

Notes from Support: Notes Encryption - Locks for a Digital World

Notes and Domino security: Past, present, and future

Look for 128-bit Notes/Domino Encryption in future Releases.


Why is my Notes client having trouble replicating over satellite links?
There is a lot more latency on satellite links. Craig Wiseman suggested these parameters for your TCP/IP adapter that connects to your satellite modem:

TCP RECEIVE WINDOW : 224360
WINDOWS SCALING : YES
TIME STAMPING : NO
SELECTIVE AKS : YES
PATH MTU DISCOVERY : YES
BLACK HOLE DETECTION : NO
MAX DUPLICATE AKS : 3
TTL : 64
MTU : 900

You can use DrTCP to make these changes.


Helpful Non-Notes Books

You can order any of these books from Amazon Books, who will give you a 20% discount on them. All you have to do is click on the ISBN number of the book in the tables below.

Search Amazon for more books:

Title
Author
Publisher
ISBN
Reviews

Enterprise.Com
Jeff Papows Perseus Books 0738200646 Ken Yee
Javascript : The Definitive Guide David Flanagan O'Reilly & Associates 1565923928
Java Servlet Programming Jason Hunter, William Crawford, Paula Ferguson O'Reilly & Associates 156592391X
Dynamic HTML : The Definitive Reference Danny Goodman O'Reilly & Associates 1565924940


Reviews are still needed.

If you've read a good Notes book lately, [email] let the FAQ maintainer know how you liked it.


Lotus Notes Magazines

The View, (800)810-1800 or (617)969-6666, $295/yr. Click [email] here to send a mail message to The View.

Lotus Notes & Domino Advisor, (800)336-6060 or (619)483-9851, $69/yr. Click [email] here to send a mail message to the Lotus Notes Advisor.

Lotus eBusiness Magazine (an on-line magazine)

Lotus Solutions Now! is a free publication on Lotus products published by Lotus.

Virtual Workgroups, (800)-227-1234, $40/yr. Not strictly a Notes magazine, but a good number of their articles describe how companies are using Notes.

netConnect, 011-44-171-221-7178, $225/yr for the printed version. This is a UK Groupware magazine with some articles on Lotus Notes. You can also [email] email them for additional info.

Group Computing, (415)348-0579, free to qualified individuals. This is a magazine that covers Notes and other groupware tools (including web based tools). [email] Contact them for more information.

Rupert's Lotus Business Week (Formerly Lotus eNews), free. A weekly email newsletter covering the business issues behind Lotus mail, groupware and web products. To subscribe, send email to [email] rupert.b@virgin.net.

Domino Power Magazine is a free monthly journal with weekly tips and daily Notes and Domino-related news.


Books for Notes 3.x

You can order any of these books from Amazon Books, who will give you a 20% discount on them. All you have to do is click on the ISBN number of the book in the tables below.


Search Amazon for more books:




Title
Author
Publisher
ISBN
Reviews

Developing Lotus Notes Applications
Carolyn Kraut Wiley Professional Computing 0471008613
Lotus Notes Answers: Certified Tech Support Polly Russel Kornblith Osborne McGraw-Hill 0078820456
Creating Lotus Notes Applications Lisa Pyle QUE Books 1565295560 Mikko Eerola
Mastering Lotus Notes Kevin, Kenyon, Kyle Brown Sybex 0782113028
Lotus Notes Application Development R. Larson-Hughes and H. Skalle Prentice-Hall 0131614991
Lotus Notes Developers Guide E. Rayl Sams Publishing 0672305003
David Gotz
Lotus Notes 3.0/3.1 for Dummies Stephen Londergan and Pat Freeland IDG Books 1568842120
Lotus Notes, A Practical Guide Simon Collin Butterworth-Heinem Ltd. 0750621095
10 Minute Guide to Lotus Notes for Windows Kate Barnes Alpha Books 1567611761
Database Development in Lotus Notes: Logical Operations Susan Reber Ziff Davis 1562762834
Easy Lotus Notes For Windows Andrew Bryce Shafran Que 1565297695
Lotus Notes: The Complete Reference Barbara Bolin and Benjamin Ordonez McGraw-Hill 007882205X
Lotus Notes Application Development Handbook Erica Kerwien IDG Books 156843089
Lotus Notes for Web Workgroups Bob Dale and Barbara Opyt Onword Press 1566901103
The Lotus Notes Idea Book Jeff Kovel Addison-Wesley 0201407876
Lotus Notes in The Enterprise Bill Kreisle and Dan Schulz M&T Books 1558514562
Lotus Notes : Release 3 (Quick Reference Guide) Larry Rosenbaum
1562432052
Lotus Notes Application Development Handbook Erica Kerwien
1568843089
Lotus Notes for Novices Allen W. Sim
0345393856
Lotus Notes Network Design John P. Lamb, Peter W. Lew
0070361606
Lotus Notes Plain & Simple Rupert Clayton
0782117538
Mission-Critical Lotus Notes David S. Marshak
0134726715
PC Learning Labs Teaches Lotus Notes 3.0 Adam A. Wilcox
1562761382
Programming the Lotus Notes API Carolyn Kraut, Mitch Allen
0471117765
Lotus Notes in Action Peter Lloyd, Roger Whitehead
3540199616
Using Lotus Notes Mark Schulman
1565296389
Help! Lotus Notes 3.0 John Helliwell
1562761609
Lotus Notes 3 Revealed! David Gewirtz
1559584335
Lotus Notes : An Introduction to Programming Tony Pompii, John Jelliwell
0131507230
Lotus Notes at Work David Dejean, Sally Blanning Dejean
0135403944
The Lotus Notes Certification Study Guide Joe Salemi
0079129269
Lotus Notes Release 3 in the Os/2 Environment Tony Walsh
047113127X
Lotus Notes System Administrator's Handbook Nicolas Behrmann
1558514872
Understanding and Leveraging Lotus Notes Marshak
9994594753


Reviews are still needed.

If you've read a good Notes book lately,

[email] let the FAQ maintainer know how you liked it.


Computer Based Training

The following companies make Lotus Notes CBT courseware:
* Self Test Software (770) 971-8940
* Lotus (800)782-7876
* CBT Systems
* ReCor
* Professor 3T (end-user training)
* Headlight.com resells a few Notes courses

* TLCC's R5 Developer courses including web development, Java, LotusScript and JavaScript (free demo course available)
* TLCC's User courses for Release 5 and 6 (free demo course available)
* Get re-certified as a Release 6 CLP with TLCC's Update course
* TLCC's Notes Domino 6 courses
* TLCC's Domino Admin 6 courses cover setup of Domino and find tuning the Domino infrastructure
* Learn WebSphere and Java development with TLCC's WebSphere curriculum
* TLCC has Notes/Domino 7 courses for developers and administrators; they cover using DB2 with Domino


Flash Cards
A demo of Bad Dog Bad!'s Flash Cards program is available [ftp] here.

Lotus Education Helpline
The Lotus Education Helpline has an Exam Guide for Lotus Notes; the number is (800)346-6409. Lotus Fax Support also has sample exam questions at 617-253-9150.

Notes Utilities

John Buckman's Lotus Notes Phone Dialer
[ftp] Alert! New Document Notifier
PutNote and GetNote


Notes Related Programs or Information

* [ftp] The LNOTES-L Archive
* [ftp] OS/2 Netware Requester Software
* [ftp] Lotus Internet Cookbook (.NSF format)
* [ftp] Notes Database Templates from Lotus
* [ftp] Lotus Notes Mobile Survival Kit


How do I publish Notes databases as Web pages?
There are a few companies that make Lotus Notes to Web page conversion programs. These programs allow anyone who has a Notes database to publish equivalent Web pages with very little work.

Lotus Internotes Web Publisher (derived from the Corporate Software product below) The InterNotes development team also has their own Web site here which has previews of features in future versions of the Web Publisher and discussions among users. Lotus Notes V4 IWP has the ability to publish and take input from forms directly, but requires the Notes server to be run on the machine used as the web server. For Notes V4.5, Lotus will be including Domino as a web server built into Notes, but this will also require a machine running Notes for the web server.

The Shelby Group's T.I.L.E. (The original Notes document library is also available here.)

Corporate Software's Web Link

There is also a program called FormGate written as a CGI script that allows filled out Web forms to be submitted into a Notes database. Note that The Shelby Group's T.I.L.E. program also supports this functionality and has hired the author of FormGate, so the functionality of T.I.L.E.'s interface will be a superset of both eventually.

Dogwood Software has a product called Site Publisher which works w/ R5.


Where can I get a Web browser gateway for Notes?
The browser gateways present the familiar Lotus Notes interface for users wishing to access Web pages on the Internet. Unfortunately, there are limitations to how HTML maps to Notes documents (e.g., Notes doesn't have doclinks into the middle of a document).

[ftp] Chris Davey's Public Domain WWW Gateway
Lotus Notes 4.x


Where can I get a Usenet News(NNTP) gateway?
There are several companies that make Lotus Notes newsreaders. These newsreaders allow users to browse newsgroups and post articles using the Lotus Notes interface. Generally, an NNTP host must be provided for the Usenet News gateways.

Lotus InterNotes News (now included with Notes 4.6)
Jsoft Technologies Notes<->Usenet Gateway
[ftp] Mike Watson's one-way Notenews Gateway for OS/2

Is there a gateway between Notes and HP OpenMail?

HP makes one. More info is available from this web site: http://www.pwd.hp.com


Who sells Notes SMTP Gateways?
Lotus sells an SMTP gateway, but the latest 1.1 version should be used (1.0 had a lot of quirks). The 1.1 version still has numerous bugs. More is known about the Lotus SMTP gateway than the other products below.

TenFour Systems from Sweden sells the TFS Gateway.

Information Electronics has a product called PostalUnion which has a centralized post office that can be interfaced to various mail systems. They have Notes and SMTP modules.

How do I keep the Lotus Mail Exchange Facility from duplicating a user in the N&A Book?
The Directory Exchange feature will copy the cc:Mail users into the Notes N&A Book. However, it will not generate a Lotus Notes fully qualified name. Edit the user document in the Notes N&A Book so it uses the fully qualified Notes name. Then, add the Notes user.
If you get a duplicate and you delete the user name in the N&A Book, the deletion will get propagated back into the cc:Mail user list. This is a bad thing to do.

LNotes-L

NOTE: this mailing list is dead as of 4/15/2007


The LNotes-L mailing list is maintained by [email] Joe Ashkar. It is a Listserver based email list for Notes programmers and administrators.

Contacting the Administrator
The administrator is Joe Ashkar ([email] lnotes-l@ashcom.net). Email him w/ any administration problems.

Subscribing
Send a message to
[email] listproc@ozzie.notesnic.net. In the body of the letter, enter SUBSCRIBE LNOTES-L <your-name>. You will then be automatically added to the list.
To subscribe an address other than the one you are sending from, send a message to [email] lnotes-l-mgr@ozzie.notesnic.net. In the body of the letter, enter SUBSCRIBE LNOTES-L ADDRESS. Replace ADDRESS with the address to send messages to. Approval generally occurrs within one day.

Unsubscribing
Send a message to [email] listproc@ozzie.notesnic.net. In the body of the letter, enter SIGNOFF LNOTES-L. You will then be deleted from the list.
To unsubscribe an address other than the one you are sending from, send a message to [email] lnotes-l-mgr@ozzie.notesnic.net. In the body of the letter, enter UNSUBSCRIBE LNOTES-L ADDRESS. Replace ADDRESS with the address you wish to unsubscribe. Approval generally occurrs within one day.

Sending Mail to the Mailing List
Address your message to [email] lnotes-l@ozzie.notesnic.net. Write your message and send it. It will be automatically distributed to the members of the list.
Please make sure that you don't use Return Receipt Requested or Carbon Copy back to the list!

Temporarily Shutting Off Mail Delivery
If you don't want to receive messages for an extended period of time (e.g., you go on vacation), but want to reserve your place in the queue, send a message to [email] listproc@ozzie.notesnic.net with a body of SET LNOTES-L MAIL POSTPONE. When you return, send a message to [email] listproc@ozzie.notesnic.net with a body of SET LNOTES-L MAIL ACK.

Getting All Messages from a Specific Day
Send a message to [email] listproc@ozzie.notesnic.net with a body of GET LNOTES-L <yymmdd>.

Searching for a Specific Topic
Send a message to [email] listproc@ozzie.notesnic.net with a body of SEARCH LNOTES-L <topic>.

Threaded Archives
Turtle's Weightless Dog site archives the list.
Connectria archives the list.


DominoLinux

DominoLinux is an open, unmoderated Internet mailing list about running the Lotus Domino Server on Linux.

Domino for Linux is an important development for the Domino community. Lotus's impending release of Domino for the popular Open Source platform is sure to introduce many people to Linux, as well as give existing Linux users access to a robust and scalable application server.

DominoLinux will be very focused on using Domino on the Linux operating system, so general questions about Domino and the Lotus Notes client are probably handled on the general Notes/Domino lists such as Domino-L (see http://www.nipltd.com/domino-l.htm) and LNOTES-L.

Archives of the list and other information is available at http://www.nipltd.com/dominolinux.htm

To join DominoLinux, send an email to

  join-dominolinux@lyris.nipltd.com

The content of your email is not important.

Mail to the list itself should be sent to dominolinux@lyris.nipltd.com

For assistance etc. please mail owner-dominolinux@lyris.nipltd.com


Oklahoma State Notes-L

Note: this mailing list is dead as of 4/15/2007

This is a Listserver mailing list that is not quite as popular as LNOTES-L, but it is nearly always operational.

Subscribing
To subscribe, send a mail message to:
LISTSERV@LISTSERV.OKSTATE.EDU.
Leave the subject line blank, and include on the first line of the message:
SUB NOTES-L first_name last_name

Unsubscribing
To unsubscribe, send the command UNSUBSCRIBE NOTES-L in e-mail to LISTSERV@listserv.okstate.edu.

Posting Articles
Send all articles to NOTES-L@listserv.okstate.edu.

Digest Mode
It is possible to receive the contents of this list as a "digest", a periodic collection of articles from the list traffic. After receiving your subscription confirmation, send the command SET NOTES-L DIGEST to
LISTSERV@listserv.okstate.edu.

Administrative Requests
Send all other list-related commands to LISTSERV@listserv.okstate.edu. For assistance, send the command HELP.
The list owners are: [email] James Alexander and [email] Konrad Brandemuhl.

Archives
This list has a threaded archive accessible by web browsers.


Oklahoma State Domino-L

Subscribing
Send an email message with "subscribe DOMINO-L" in the body to LISTSERV@LISTSERV.OKSTATE.EDU.

Unsubscribing
Send an email message with "signoff DOMINO-L" in the body to LISTSERV@LISTSERV.OKSTATE.EDU.

Sending messages to the list
Send mail to DOMINO-L@LISTSERV.OKSTATE.EDU.

Archives
This list has a threaded archive for access by web browsers.


Portugese Notes Users Mailing List
To subscribe: "lotusnotes-br-subscribe@yahoogrupos.com.br"

David Stephens' Lotus Product/Event News

This is a Lotus support person that puts out great newsletters to keep his customers in touch with various Lotus info:
Send an e-mail to david_stephens@us.ibm.com with the subject line "Subscribe Lotus Product and Event News" (remove the quotes).

LNotes-J
This mailing list for Japanese Notes users. You can subscribe here:
http://www.iij-mc.co.jp/MLOnline/IIJ/98/lnotes-j.html

And there are archives here:
http://www.uisystem.co.jp/


Yahoo LNotes-L Group
This list is a replacement for the recently deceased LNOTES-L mailing list:

http://tech.groups.yahoo.com/group/lnotes-l-new/


LNotes-L on Yahoo

Subscribing
You can get more info on the web site for this user group:
http://tech.groups.yahoo.com/group/lnotes-l-new/


How many users can be placed on a Netware Notes server?
100-120.

How do you configure Notes for OS/2 with 64MB?
Make sure the following variables are set in your notes.ini file:

NIF_POOL_SIZE=524288
NSF_BC_POOL_SIZE=524288
NSF_POOL_SIZE=524288
NSF_BUFFER_POOL_SIZE=12582912

What is the maximum IPX packet size the OS/2 server can accept?

The Netware OS/2 requester can only handle a maximum packet size of 512 bytes. Make sure that the client is not sending bigger packets. A corrupted ID file error message on connection is an indication of chopped off packets.


How do you set up a Digiboard under OS/2?
The following configuration setup is only a guideline. The memory address settings may very. Take the following steps if installing the Digiboard EISA board into a Compaq EISA system:
Set the 1-8 DIP Switchbox to have all switches set to OFF
Set the 1-11 Dip Switch Box to have 1, 3, and 4 set to OFF and the rest ON (This sets Memory Start Address for 0D000h and I/O Port Address for 320h)
Put the Digibaord in an empty slot on the Motherboard
Close the case on the Computer
Place the COMPAQ System Configuration Diskette in a drive
Turn on Computer
Press any key at the "Compaq System Configuration" screen
If an "Autoconfigure" screen appears, select Yes to have the computer autoconfigure the system. If the "Autoconfigure" screen does not appear and a "Welcome" screen does, press ENTER
If you selected Autoconfigure, select OK at the "Configuration" screen. If no "Autoconfigure" screen appeared, select Configure Computer from the Main Menu and press ENTER (this will process for a few minutes)
Select Step 2: Add or Remove boards and press ENTER
Select the slot number for which you entered the DigiBoard and press ENTER
Select Non-COMPAQ board and press ENTER
Place the NON-COMPAQ Option Configuration Files diskette in the drive and press ENTER
Select the Digiboard Digichannel PC/8e (or equivalent) from the Add Configuration (CFG) File screen and press ENTER
Insert the System Configuration diskette in the drive and press ENTER
Press ENTER at the "Add Confirmation" pop-up
Select the slot number for which you entered the DigiBoard and press ENTER
Confirm that the DigiBaord appears in the Slot and press ENTER (Add-Insert)
Press Esc
Press F10
Select Step 3: View or Edit Details and press ENTER
Page Down until you see the DigiBoard information
Highlight the DOS or OS/2 line and press ENTER
Select Available Resources Options and press ENTER
Press ENTER
Press F6 for Edit Resources
Press the plus (+) key until the I/O Port Address equals 320h (or whatever you set the board to in Step 2)
Press F10
Press F10 again
Select Step 5: Save & Exit and press ENTER
Select Save the configuration and restart the computer and press ENTER
If you would like to Install OS/2 at this time, insert the OS/2 Installation diskette at the "Reboot" screen and press ENTER (skip Step 1 of Installing OS/2 2.1). If you do not want to install os/2 at this time, turn the computer off at the "Reboot" screen.
Installing DigiBoard Software:
Go to the OS/2 Full Screen prompt
Type MD DIGI and press ENTER
Type CD DIGI and press ENTER
Insert the Digiboard Diskette in the drive
Type COPY A:\OS2\*.* and press ENTER
Editing the CONFIG.SYS
Go to the OS/2 Full Screen prompt
Type E CONFIG.SYS and press ENTER
Go to the end of the line that says "DEVICE=C:\OS2\MDOS\VWIN.SYS" and press ENTER
Type DEVICE=C:\DIGI\XALL.SYS /n:3 /a:q /b:57600 /d:N8 1 /p:320 /m:D0000
Save the CONFIG.SYS by pressing Alt-F4 and selecting Save

Can other NLMs be run on the same server?
This is not recommended. Notes indexing and maintenance tasks use all CPU time when they are running.

[<a name="NT00000A3E">
How do you change the new mail sound on a Mac?</a>]

You can use ResEdit to change the "New mail Sound" resource in the Notes executable:

1) Make a copy of your Notes program.
2) First convert your gotmail.wav (if you have a .wav file) to a gotmail.snd.
3) Open the gotmail.snd with ResEdit.
4) Open the Notes program with ResEdit.
5) Open the snd resource group of Notes.
6) Find the "New mail Sound" snd resource in Notes, make a note of its resource ID (should be 9000).
7) Delete this resource.
8) Copy the gotmail snd resource from the gotmail.snd file.
9) Paste it into Notes.
10) Rename it to "New mail Sound", renumber it to the correct ID number.
11) Save Notes.


How do you set up server proxying through MS Proxy Server?

From Mark Kaynor (mkaynor@daa.com)

I recently spent an inordinate amount of time setting up server proxying on MS Proxy Server 2.0 such that a Domino server or Notes client outside the proxy (the "external server") could replicate w/ and route Notes email to a Domino server inside the proxy (the "internal server"). Information was sparse and I had to glean bits and pieces from several, sometimes conflicting, sources of
information. I could have saved myself hours of frustration had I been able to find a document similar to this. No guarantees, but this should get one pointed in the right direction.


If problems occur, don't forget to check the event log on the internal server - the proxy client writes messages to the event log which can be very helpful during configuration and troubleshooting. BTW - both Domino servers are running v4.6.4 on NT 4.0, SP5., the proxy server in running on NT 4.0, SP3 w/ roll-up hotfix and Option Pack 4.

1) Obtain and install the Proxy Server hotfix - make sure to compare installed files date and size w/ those listed in the supplied "readme.txt" file after installation. MS tech support told me that setting up server proxying was pretty much futile w/o the hotfix. The file emailed to me was:

     prxyfixpacki.zip         308,819 bytes        6/28/99 11:45a

2) To simplify the initial setup, temporarily disable Winsock Proxy Access Control if enabled. Clear the WinSock Proxy | Properties | Permissions | "Enable access control" checkbox.

3) Also temporarily disable Packet Filtering if enabled. Clear the WinSock Proxy | Properties | Service | Security | "Enable packet
filtering on external interface" checkbox.

4) Set proxy client configuration to connect to proxy via IP address. Select WinSock Proxy | Properties | Service | Client Configuration | Clients connect to Microsoft WinSock Proxy Server by | "IP Address" checkbox.

5) On the proxy server, disable default gateway and IP forwarding on internal NIC. Clear Control Panel | Network | Protocols | TCP/IP Protocol | IP Address | "Default Gateway" entry. Clear Control Panel | Network | Protocols | TCP/IP Protocol | Routing |
"Enable IP forwarding" checkbox.

6) Add port 1352 to the SSLPortListMembers list in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3Proxy\Parameters (see Microsoft Knowledgebase article Q184028 <http://support.microsoft.com/support/kb/articles/q184/0/28.asp>. Run REGEDT32. Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3Proxy\Parameters. Open "SSLPortListMembers". Add 1352 twice to the list - it should end up looking something like:

          443
          443
          563
          563
          1352
          1352

7) Reboot the proxy server

8) Reinstall proxy client on internal server. Reboot internal server

9) Test client installation on internal server by running "chkwsp /f", located in the MS Proxy Client install directory (default is "c:\mspclnt"). Success = "Client control protocol version MATCHES the server control protocol."

10) Create and save WSPCFG.INI file on internal server in same directory as NSERVER.EXE ("C:\Notes", for example) as follows:

     [Common Configuration]
     ServerBindTCPPorts=1352
     Persistent=1
     KillOldSession=0

11) Reboot internal server - proxy client on internal server should now bind to port 1352 on proxy server

12) Open CMD prompt, test proxy client connection using "ftp ftp.microsoft.com". Success = ability to logon anonymously to ftp.microsoft.com and do a directory listing

13) From the Internet <preferably from an entirely separate connection> try to telnet to port 1352 on the proxy server's external IP, eg.:
Start | Run | "telnet.exe"
Select "Connect"
Select "Remote system"
Port: 1352 <Windows Telnet defaults to Port: Telnet>
Address: <proxy server's external NIC IP address>
Success = after connecting, the "Disconnect" selection is available under main menu "Connect"
Disconnect, close Telnet

14) Create a "Local Area Network" TCPIP connection document on the external server (or client) that points to the internal Domino server name using the proxy server's external NIC IP address.

15) Remove all entries in "Web Proxy" section of current location document on external server (or client)

16) Open Notes client on external server and trace a connection to the internal server. "File | Tools | Preferences | Ports | Trace Connection", select internal server. If successful, go to step 20.

17) Stop external server Domino services <"quit" at Domino terminal> (we had an active dialup modem connection that was screwing up the ability of the internal server to bind to proxy server port 1352 - stopping the outside Domino service removed that conflict so we could test)

18) Reboot internal server - client should now successfully bind internal server to proxy server port 1352

19) Still having problems? Use "netstat -an" to review port bindings on proxy server, internal and external servers. Proxy server should show port 1352 bound to internal server's IP address. You can't continue past here until you can "see" the internal server from the external server via the proxy server's external IP address.

20) Restart external server Domino service and make sure everything works correctly.


To enable access control:

21) Create new user in "User manager for domains", as a member of the "Domain Users" group

22) Grant this user "Policy | User Rights| Log on locally", also in User Manager for Domains

23) Re-enable Access control on proxy server

24) Add new user to "Unlimited access" (for security reasons you should change this to a custom protocol later)

25) Open command prompt on internal server

26) Make "c:\mspclnt" your current directory (assumes default proxy client installation location)

27) Create credentials for nserver.exe, nrouter.exe, and nreplica.exe as follows:

     credtool -w -n nserver -c NewProxyUser Domain Password
     credtool -w -n nrouter -c NewProxyUser Domain Password
     credtool -w -n nreplica -c NewProxyUser Domain Password

where NewProxyUser is the new user created in step 21, Domain is the NT domain to which the proxy server belongs, and Password is the password assigned to NewProxyUser. The credentials for each service can be checked by replacing the "-w" <write> in the above commands with "-r" <read>

28) Add the line "ForceCredentials=1" to the WSPCFG.INI file you created in step 9. e.g.:

     [Common Configuration]
     ServerBindTCPPorts=1352
     Persistent=1
     KillOldSession=0
     ForceCredentials=1

29) Reboot the internal server

30) Test that the outside and internal servers can still communicate correctly

To enable packet filtering

31) In WinSock Proxy Security, select "Enable packet filtering"

32) Add two custom filters as follows:

     Protocol: TCP
     Direction:     In
     Local port:    Fixed, 1352
     Remote port:   Any
     Local host:    Default Proxy Server external IP addresses
     Remote host:   Single host, <external server IP>

and
     Protocol: TCP
     Direction:     Out
     Local port:    Any
     Remote port:   Fixed, 1352
     Local host:    Default Proxy Server external IP addresses
     Remote host:   Single host, <external server IP>

33) Test that the external and internal servers can still communicate correctly


Which file system should be used for the Notes server?
OS/2 has three supported file systems: FAT, HPFS, and HPFS386.

The OS/2 2.0+ implementation of FAT is 32-bit and gets slightly higher performance than the HPFS file system shipped with OS/2 2.0+. However, when a large number of files is created and destroyed on a FAT file system, it tends to get fragmented more than a similiar HPFS file system would.

The normal HPFS that is shipped with OS/2 2.0 and above is still 16-bit. There are some rumors that IBM will ship HPFS386 with OS/2 eventually, however. HPFS smart caching takes up more memory than a FAT system.

HPFS386 comes with IBMs Lan Server Advanced. It is fully 32-bit and gives a 10-15% performance gain over the regular version of HPFS. Lan Server does not have to be used on the OS/2 system, but it must be installed and a license purchased to legally use HPFS386.

Does Notes use multiple processors under Solaris?
Notes 3.2 uses up to two processors. Notes server tasks can be run on different processors.

Which versions of Solaris are supported?
The 3.1.5 version of Lotus Notes supported Solaris 1.x (basically SunOS 4.1.3). The 3.2 and later versions of Lotus Notes works on Solaris 2.x.

Why does the Lotus SMTP Gateway have problems writing files?
The user name under which Notes runs should be set up to use csh instead of sh. The Bourne Shell doesn't read the .profile file when it starts up using the default installation of the SMTP Gateway.

How do you set up a printer under Solaris?
Notes uses the PRINTER environment variable to define the printer to use.

Can the Notes be set up so the user only has to log into the network once?
Put the Notes data directory on a private Netware directory for each user. The directory should be mapped to a consistent letter in the login script, and the user.id, notes.ini & desktop.dsk should be in this directory (not in c:\windows). Make sure references in the notes.ini are to this drive letter, too. The user.id file should not have a password; you will be relying on the Netware logon password.

Which platform is best for a Notes server?

The best platform depends on the software you need to run and local politics :-)

Most new Notes software used to appear first on the OS/2 platform because that is what the Notes server was originally developed to run on. With Lotus support of additional platforms, more software is appearing simultaneously on other platforms with Windows NT being the second most popular in terms of software availability. However, as of Notes 4.x, Lotus has switched to developing on NT first because of the better development tools on that platform; some Notes add-ons only work on Win32 (Windows NT and Win95) and the Notes client works best on Win32.

Unix support is much better in R4, but the 3rd-party developers continue to write for NT as the main target platform.

For serious numbers of users per server, look at the AS/400 native port; there have been reports that over 10,000 users (using partitioned servers) can be placed on it without any problems.

Performance evaluations are available from:
* IBM
* NotesBench


How do you get NT to reboot automatically after the Blue Screen Of Death?

Using regedit, change the registry key:

  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\CrashControl\AutoReboot

to have a DWORD value of 1.


How do you generate a core dump for IBM to look at?
There is a program in the OS2 directory or a subdirectory of it called DDUMP.EXE. This program will create a dump disk for you to use when you get a trap like this one.
Once the server crashes with the trap insert the dump disk and hit the following keys:

Control - Alt - NUM LOCK --  NUM LOCK  (Yes, hit NumLock key twice.)

Just a word of caution. 48 MB of ram created 25 Disks. The dump Disk is needed to start the memory dump.

How do you run the server and client on the same NT machine?
The Win16 client is required in order to complete the server install (install the client, but don't launch Notes when it asks. The server installation will start Notes for you, and create a server administration icon for you) and to perform certain server administration functions that require the graphical interface (with the server DOWN, in much the same fashion as the Netware Notes server).

The good news is that it *is* possible to get the server and a client working on the same physical machine by using multiple NOTES.INI files. The client will even communicate with the server using the NetBIOS networking protocol on a single machine. Just be sure to back up all the important server files before trying this (primarily names.nsf, notes.ini, and the *.id files).

What you'll want to end up with is the server's NOTES.INI file in the NT system's path (i.e., in

C:\WINNT35\SYSTEM32
), and a completely separate NOTES.INI file, for the client which is *NOT* in the path. You will then start the server normally (either as an application or as an NT service), and it will find it's NOTES.INI file and be happy. You will start the client with a command line similar to the following:
C:\NOTESCLI\NOTES.EXE =C:\NOTESCLI\NOTES.INI

where
C:\NOTESCLI
is not in the path.

Where can I find info on Mac-specific (not Notes-related) problems?

Check the following WEB sites:

* The Macintosh Resource Page
* The MacInTouch Home Page
* The Cult of Macintosh
* The EvangeList Web Site

If those don't have an answer to your Mac questions, they have links to numerous other sites for software downloads and other software and hardware questions. In addition, there is the I/O MUG - Internet ONLY Macintosh User's Group mailing list. To subscribe, send
SUBscribe IO-MUG <full name>
to
LISTSERV@UTARLVM1.UTA.EDU


How do I install Notes as an NT Service?

Switch to the Notes server's program directory in the command prompt.
Type "ntsvinst -c", then exit back to program manager.

This makes the Notes Server a manual NT service. To make it automatic, go to Control Panel/Services and select Automatic under the start up options for Notes.

If you cannot find the ntsvinst.exe program, you probably didn't install it. Rerun the Notes install, choose the Custom install option, and select the Run As NT Service option.


How do you set up NetBIOS?

For Notes 3.x, NetBIOS must be on port 0 under NT. Under Notes, the NetBIOS port must be on LAN Unit 0.
For Notes 4.x, you can set the LANA number. The Unit number in the Notes port setup has to match the Nbf LANA number in NT's protocol configuration (look under ControlPanel/Network/Services/NetBIOS).


Is the Netware NLM version of the Notes server stable?
There have been reports that the 3.1 version was very flaky. The 3.2 version is supposed to be stable.

Why doesn't Full Text Indexing work?
If you are not running the Version 3.3 of Notes or above, upgrade. The console has been locked with set secure and Netware wont let the Full Text Indexing NLM load. Alternatively, put the NLM in the SYSTEM directory because the secure mode only allows NLMs in this directory to be loaded.

Why can't I print to a network printer from Notes?


Notes 3.x needs to print to a LPT port , for example LPT2:\\servername\queuename.

When you open the printer console (the Win95 one- Use "My Computer | Printers), Select "Printer | Properties" then select the "Details" tab on the properties, there is a button there which allows you to capture a LPT port. After capturing, then change the print mapping in the box above it to the new one which should read LPT2:\\servername\queuename.

If the destination printer is of the form \\servername\queuename, Notes will not like it .


How do you back up the server automatically?
Create a batch file with the following commands:

@echo off
net stop Lotus Notes Server
ntbackup BACKUP c:\ /D Notes Server Backup /hc:on /B /T Normal
net start Lotus Notes Server

This assumes that the Notes server is running as a Windows NT service and the server Notes ID is not password-protected.

How do you set up the modem port for Solaris 2.x?
Notes expects the Notes port name to match the /dev name. Do not enable getty on this port. Install Sun Patch 100513-04. Set hardware handshaking in the EEPROM.

How many users can be placed on an OS/2 Notes server?
70-80.

How do you run the Notes server in the background but still be able to control the console?

You can use the GNU program called Screen to run the Notes server. You can then detach and re-attach to this window as needed from any telnet session. You can find it at any GNU software archive.

For Linux and Solaris, you can modify your rc3.d script to include this line:
su - notes -c "screen -d -m -S NotesServer server"


Do I have to install the Notes/Domino Server on Windows Server?
No, you do not need to install the Lotus Notes/Domino server on a Microsoft Windows Server if you are installing it on Windows. You can install it on Windows 2000, XP, etc. However, IBM/Lotus has a list of supported operating systems that they've tested on and may complain if you try to report a problem that happens on an unsupported platform.

How do you lock a document that is being edited?

You need to have a button to start editing these docs. The button will set a field (e.g. 'EditFlag') to a certain value and save the document at once, and then let the user edit the doc. When he finishes, he has to save the document again, with another button, which will delete the field and save the doc. If another user tries to edit the doc while the field 'EditFlag' is set, an error message stating 'this document is being edited, please try later again' would appear.
If the user crashes during the edit, the flag will be left on and you will have to use a macro to clear the edit flag on the document.


Why don't bitmaps display properly on some systems?

Notes uses a specific set of 256 colors for display; Notes will force all images to be displayed using these colors. On systems that have video drivers that have 256 colors or less, you will have to use the same 256 colors that Notes uses. On systems with more than 256 colors, this is not an issue.

The palette is available below in several formats:

Adobe Photoshop: lotus.act
MS Paint (Win95 and NT): lotus.pal
Corel Draw: lotus.cpl


How do you write DbLookups so they work on a local database and on the server?

Use @Dbname to test for the location using these formulas::

DBName := @Text(@DbName);
Server := @Subset(DBName; 1);
Database := "KeywordLookup";
ClassCache := "Notes" : "NoCache";
View := "LookupKW";
Key := "Key Name";
@DbLookup(ClassCache; Server : Database; View; Key; "Ret_Value")

Now you can substitute the Server and Database variables everywhere in the Notes application. DbLookups or @Commands will automatically run local when the user is local and run on the server when the user is on the server.


How do you display a button next to a field only when editing?

Duplicate the line with the field and button and remove the button from the copy.
Change the field to a computed-for-display field with a formula of just the name of the original field.

Mark the original line hide when reading, and the copy hide when editing.


How do you validate that a field has alpha characters only?

Use the following for an Input Validation Formula:

@matches(string;"+{A-Za-z}")


How do you categorize and count the number of documents created in a particular week?

Category field (Date format, "Created" is the field with the creation date):

        @adjust(Created;0;0;1-@weekday(Created);0;0;0)

Summation field (number format, that's right, just a number 1 to total up):

        1

This creates a view catagorized by a field that has the "previous Sunday" computed.
Set up category totals in the view for the summation field and you'll have what you want.


How do you reduce database size by deleting unused fields?

Delete the fields before the doc is saved by adding code like this to the fields' translation formula:

  @If (x="";  @DeleteField;  x)

Make sure the x's are exactly the field name, or you will loose data.
Do not delete fields if they are used in other formulas.

How do you make a SmartIcon that inserts a bullet into a Rich Text Field?
Use this formula for the SmartIcon:

@Command([TextSetFontFace]; "Symbol");
@Command([TextSetFontSize]; "10");
@Command([TextSetFontColor]; [Red]);
@Command([EditInsertText]; "?");
@Command([TextNormal]);
@Command([TextSetFontFace]; "Helv");
@Command([TextSetFontColor]; [Black]);
@Command([EditInsertText]; "  ")

[<a name="NT00000A06">How do you do looping in macros?
</a>]

This can be done using the following 3 macros:

Start Loop Macro

m := @Prompt([OKCANCELEDIT]; "Loop"; "Enter number of times to loop"; "");
n := @Text(@TextToNumber(m) - 1);
@SetEnvironment("LoopMax"; n);
@SetEnvironment("LoopCnt"; "0");
@Command([ToolsRunMacro]; "Ping")

"Ping" Macro
cnt := @TextToNumber(@Environment("LoopCnt"));
max := @TextToNumber(@Environment("LoopMax"));
@If(cnt > max; @Return(""); "");
REM "Now do all the fancy processing stuff you want to do";
@Set("cnt"; cnt + 1);
@SetEnvironment("LoopCnt"; @Text(cnt));
@Command([ToolsRunMacro]; "Pong");

"Pong" Macro
@Command([ToolsRunMacro]; "Ping");

Notes:
1. Ping and Pong are identical, except in the @Command([ToolsRunMacro]) line.
2. The 'fancy processing stuff' can include @Commands!
3. Ping and Pong must always finish at the view level, so that they can execute the @Command([ToolsRunMacro]) command.


How do prevent people from mail bombing you with unreadable messages?
Create a Paste/Mail Macro on your mailbox. Add the line:

FIELD $READERS := @deletefield

This will make the messages readable. If you can't read the mail message, you also can't delete it.

How do you automatically copy an ACL from a template into a new database?

If you enclose the ACL's in bracket's, like so:


[-Default-]
No Access
[Administrator]
Manager
[LocalDomainServers]
Manager
[OtherDomainServers]
No Access

they will be copied automatically to any new databases you create using that template. However, role information is not copied automatically.


How do you display a number field with leading zeroes?

For a number with exactly 5 characters in its display:

  textnum := @Right("00000" + @Text(num);5);


Why doesn't @UserName work in public views?

@UserName is evaluated as the SERVER's name when used in public views since these views are maintained by the server. It evaluates to the USER's name when in design mode or in private views.


How do I set up an automatic "I'm on Vacation" mail message?
Set up a background macro in your mail database. This should be run on documents not processed by the macro and it should be run your mail server. The formula is:

@If(DeliveredDate = "" | From = "Your Name"; @Return (""); DeliveredDate > [06/30/93 05:00:00 PM]; @MailSend(From;"";"Your Name"; ""; "re: Memo sent to Your Name" + Subject; "Thank you for your correspondence.  I shall return."); @Return(""));
SELECT @All

Remember to put your name (Your Name in the above example) and the date to check (6/30 in the above example) in the correct places in the macro.

How do you prevent a form from prompting to save it?

Create a hidden field with the name SaveOptions and make it computed with value "0" (zero in quotes).

Note that this will let the user close the document without prompting for a save, but it will not save the document. You have to manually save the form via script or an @Command if you really want to save the document.

How do you update another form with information from the current form?
Both forms must have a unique key field (a formula for this can be found here). There must be a hidden view of the destination documents with the first column being the unique key. Variables are passed using environment variables. This code would go in the source form's update button:

@If(@IsNewDoc; ""; @Do(@Command([FileSave]); 
@Command([FileCloseWindow]); @Return("")));     
ENVIRONMENT CTDB1 := @Trim(UniqueID);
ENVIRONMENT CTDB5 := @Trim(@Text(Qty));
@Command([OpenView]; "(SpecialView1)"; CTDB1);
@Command([ToolsRunMacro]; "(UpdateReceivedQty)");
@Command([FileSave]);
@Command([FileCloseWindow]);
@Command([FileSave]);
@Command([FileCloseWindow]);
@Command([EditDocument])

The UpdateReceivedQty macro would then do the following:

FIELD QtyInStock := QtyInStock;
@If(UniqueId != @Environment("CTDB1"); @Do(@Prompt([OK]; "Error"; "UniqueId Number " + @Environment("CTDB1") + "cannot be found"); @Return("")); "");
@SetField("QtyInStock"; (QtyInStock + @TextToNumber(@Environment("CTDB5"))));
SELECT @All

Can you inherit fields from parts of the same form?

Yes, as long as the field you wish to inherit into is below the field you want to inherit from.

This means if have field B below field A, field B can reference the contents of field A in it's computed formula.


How do you do a mail merge using info from existing documents?

A user wants to select a number of customer documents and then run a macro which composes a standard document for each of the selected customer documents.

Have the macro's Operation set to Compose new documents when run.
In the Formula add a statement:

  FIELD Form := name_of_the_standard_document_form;

The form to be composed should have inherit turned on so fields from the selected docs will appear in the new form.

If you only need to print out forms with existing data, this is even simpler. Highlight the documents in the view and then select File, Print, Form Override.

Does Section Security work?
With Notes 3.0c, If you add a section with Security, the security for that section holds over to any sections below that section. Upgrade server and clients to ver. 3.2 or above.

How do you generate sequential document IDs?

Computer Associates sells a sequential number generator as part of the QXCOM Tools.

A company called Sentor Communications also has a product called SequelNum. Call (+61 2 9391 0544) or [email] email for more info. The list price is US$155 or AU$195.

I company called SISDAM also has Loyal Sequencer.

Under Version 4, you can use a triggered agent on the server which uses a locked file like so:

  Sub Initialize
  file% = Freefile
  Open "c:\\seqnum.bin" For Binary Access Read Write Lock Read As file%
   ' You can also use Open "\\NotesServer\SharedDirectory\seqnum.bin"
   ' if your client and server are Win95 or NT based.  Open can take
   ' a UNC path
  Get #file%, 1, SeqNum%
  SeqNum% = SeqNum% + 1
  Put #file%, 1, SeqNum%
  Close file%
  End Sub

This method does solve the race condition possible if you use the "field stored in a document technique", but the limitation of this is that it won't work with replicated databases (user or server). However, note that this agent cannot be run from the client because running from the client will cause the sequential numbering file to be created on the client machine.

Here is another technique that will work only if your client machines access a non-replicated database on a single server:

' MBCounter&(CounterName$, CounterToSave%)
'
' Marco Beri 
' marcob@equalis.it
'
' This functions give one or more progressive unique counters without race conflict condition
'
' Parameters:
'    CounterName$: counter name; every counter name represents a different counter; you could have as many counters as you want
'    CounterToSave%: if false MBCounter& just returns next free number, if true it gives you next free number and increment it by one
'
' Return value:
'    a long integer
'
' Usage:
'   MBCounter("EveryCounterNameYouWant", False) in QueryOpen if and only if it is a new document and just to display the next free number.
'   MBCounter("EveryCounterNameYouWant", True) in QuerySave if and only if it is a new document, just before exiting and only if you really
'   save the document (so you are sure not to waste a free number)
'
' 
Attention:
' - you cannot use form, view or folder with a name like (MBCounters); if you need this name change COUNTER_FOLDER_FORM_NAME$ constant value
' - if you want you can create a view to visualize the document with form COUNTER_FOLDER_FORM_NAME$ to check the counter values
'

Option Public
Option Explicit
Const COUNTER_FOLDER_FORM_NAME$="(MBCounters)"

Function MBCounter&(Byval CounterName$, Byval CounterToSave%)
     On Error Goto MBCounterError

     Dim CounterFieldName$
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim view As NotesView
     Dim doc As NotesDocument
     Dim docNext As NotesDocument
     Dim CounterValue&
     Dim FieldValue As Variant
     Dim Ret%
     Dim item As NotesItem     
     Dim FolderToBeCreated%
     
     CounterFieldName$ = "MB"+CounterName$
     Set db = session.CurrentDatabase
     Set view = db.GetView(COUNTER_FOLDER_FORM_NAME$)
     If view Is Nothing Then
          FolderToBeCreated%=True
     End If
     
     Do
          If Not FolderToBeCreated% Then
               view.refresh 
               Set doc = nothing
               Set doc = view.GetFirstDocument()
          End If
          If doc Is Nothing Or FolderToBeCreated% Then               
               Set doc = New NotesDocument(db)
               doc.Form = COUNTER_FOLDER_FORM_NAME$
               Call doc.Save(True, False)
               doc.putinfolder COUNTER_FOLDER_FORM_NAME$
               If FolderToBeCreated% Then
                    Set view = db.GetView(COUNTER_FOLDER_FORM_NAME$)
                    FolderToBeCreated% = False
               End If
          Else
               Set item=doc.GetFirstItem(CounterFieldName$)
               If item Is Nothing Then
                    Call doc.ReplaceItemValue( CounterFieldName$, 0 )
                    Call doc.Save(False, False)
               Else
                    FieldValue=doc.GetItemValue(CounterFieldName$)
                    If Not CounterToSave% Then
                         CounterValue&=FieldValue(0)+1
                         Exit Do
                    Else
                         Call doc.ReplaceItemValue( CounterFieldName$, FieldValue(0)+1)
                         Ret%=doc.Save(False,False)
                         If Ret% Then
                              CounterValue&=FieldValue(0)+1
                              Exit Do
                         End If
                    End If
               End If
          End If
     Loop

     ' This deletes double docs incidentally created in the Loop (almost impossible 
     ' to happen, just first time and not a problem, but just to be clean)
     ' [For the race condition at the start if two users access an uninitialized
     ' counter at the same time.  The best workaround for this is to create
     ' the initial counter by hand..Ed.]
     Set doc = view.GetNextDocument(doc)
     Do While Not doc Is Nothing
          Set docNext = view.GetNextDocument(doc)
          Call doc.Remove(True)
          Set doc=docNext
     Loop
     
     MBCounter& = CounterValue&
     
MBCounterExit:     
     Exit Function
     
MBCounterError:     
     Msgbox "MBCounter", Err, Error$
     MBCounter& = -1
     Goto MBCounterExit
End Function


How do you make a view to use for checking for replication conflicts?

Conflict documents contain the field $Conflict, so you could use

  Select @IsAvailable($Conflict)

in a view's selection formula. Also, be sure "No Response Hierarchy" is on in the view attributes since conflict documents are response documents.


How do you force the value of a field to be unique?

This assumes you have a field named CompanyCode as an editable field. It also assumes that you have a view called "Company Code" which has CompanyCode column.

Use the following input validation formula for CompanyCode:

  @If(
       CompanyCode = "";
         @Failure("You have to fill in Company Code");
         @IsError(
             @DbLookup("" : "NoCache";  ""; "Company Code"; CompanyCode; CompanyCode));
           @Success;
         @IsNewDoc = 0;
           @Success;
       @Failure("The company code you entered has already exist, please change it")
     )

This formula first checks to make sure a value is entered. If a value is entered, it then uses that value as a key to lookup into the Company code view for a document containing that company code; if no document with that code is found, an error condition is created, which satisfies the @IsError @Function, and returns @Success. If a document with that code is found, the code is returned, which does not satisfy the @IsError function, causing the @Failure message to be returned.


How do you find the positions of a string in a text list?

Field - List = your input list
Field - FindChar = the thing you're trying to find in the list
Field - Position = multi value field with final position of the characters you're looking for.

Button code used to find the position of all of your characters:

NumInList := @Elements(List);
TargetFindList := @Explode(@Repeat(FindChar + ", " ; NumInList -1) + FindChar);
SeqList := @Text(@TextToNumber(("0":"1":"2":"3":"4":"5":"6":"7":"8":"9") *+
  ("0":"1":"2":"3":"4":"5":"6":"7":"8":"9")));
Seq := @Subset(@Subset(SeqList; -99); NumInList);
AltFindList := List + Seq;
AltTargetFindList := TargetFindList + Seq;
FindPos := @Replace(AltFindList; AltTargetFindList;Seq);
Final := @Trim(@Replace(FindPos;AltFindList;""));
@SetField("Position";@Trim(@Replace(FindPos;AltFindList;"")))


How do you remove an element from a Textlist field?

You can use this formula to remove a user from a names Textlist field:

  FIELD NamesField := @Trim(@Replace(NamesField, "Joe Schmoe", ""));


How do I check whether a field has changed during an edit session?
Assuming the field you want to check is named Field1, add a hidden Calculated for Display item named OldField1 with the formula:

@If(@IsDocBeingLoaded; Field1; OldField1)

This has to be placed above the Field1 field on the form. In the formula for Field1, put in:

@If( @IsDocBeingSaved;
  @If( Field1 <> OldField1; 
    <Saving and it HAS changed>;
    <Saving but it has NOT changed> );
   <Not saving yet!> )

How do I get the week ending date for a specific day?
Assuming tdate contains the day you'd like to convert:

@If(tdate != ""; @Adjust(tdate; 0; 0; @Modulo(8 - @Weekday(tdate); 7); 0; 0; 0); tdate)

Why does @Explode only give me the first item?

The problem is that @Explode stops when it encounters a space or a period. You need to replace them as shown below:

 TextSrting := @ReplaceSubstring(@ReplaceSubstring(@Implode(TextList;"~");" ";"^");".";"`");
 NewTextList := @Explode(TextString;"~")

This example replaces space with "^" and periods with "`" before you do the explode. If you use elements of the new textlist, remember to convert these characters back to spaces and periods.


How do you delete Environment variables from the notes.ini file?

ENVIRONMENT environmental variable := ""; 

If you're inside a formula, use this instead:

@SetEnvironment("environmental variable";"").


How do you prevent people from viewing with a different form and saving the result?

Method 1


Create two fields, 'origForm' and 'formCheck'. 'origForm' is computed when composed with the formula: Form. The 'formCheck' field is a hidden editable field with a translation formula of:

@If(@IsNewDoc=0 & origForm <> Form; @Prompt([OK]; ""; "You cannot use the view menu to compose new documents.  Use the Compose menu or buttons.  You will not be permitted to save this document"); "");

In the validation formula, there is a copy of the above formula with @Failure instead of the @Prompt.

Method 2

1. Take all the forms out of the Compose menu. This will remove them from the View menu.

2. Add buttons for Compose. You can set up a Menu form or document with buttons on it, from which all Compose and View statements are executed. You can put this menu in a separate database or if you put in in the same database, create one instance, and then hide the form from the Compose menu.


How do you send a mail message with an embedded doclink?

This is commonly used in workflow applications to send a notification of a change in state of a request. Here is the proper syntax:

@Mailsend("sendto"; "copyto"; "blindcopyto"; "subject"; "remark"; "bodyfield1":bodyfieldn"; [flag1]:[flagn])

Here is an example:

I want to initiate an @Mailsend to a user in the author field of a document. I want to send him some info on an approved request. Here is the syntax I would use:

@Mailsend("John Doe"; ""; ""; "Your request is approved"; "If you have any questions, please let me know"; ""; [IncludeDocLink])

John Doe=sendto
""=copyto (null value)
""=blindcopyto (null value)
Your request is approved=subject
If you have questions...=remark
""=bodyfield1
[IncludeDocLink]=[flag1]

What actually happens is the remarks field and all the bodyfields (along with the doclink) get concatenated in the rich text field of the mail message.


How do you sum number fields which have not been edited and initialized?

There are a few approaches to this problem. All of them include testing the value of each number field before summing the total:

mtotal := @If(field1 = ""; 0; field1) + @If(field2 = ""; 0; field2) +...;

Or in the input translation of each field you can do this:

@If(@IsNumber(FIELDNAME); FIELDNAME; 0)


Is there a workaround for the bug in @IsNumber?

@IsNumber has a bug where it can't discern between "123" and "123a". To get around this, use a combination of @TextToNumber & @Text.

1. FIELD testNum must be a number field.

2. For the Input Translation formula, use

@TextToNumber(@Text(testNum));

3. For the Validation Formula, use
@If(@IsError(testNum);@Failure("Field testNum not a number!");@Success);


How do you select only Response documents in a view?

Turn off Show Response Hierarchy in your view properties and then and use this as your view selection formula:

  SELECT @IsAvailable($REF)

You can also do it using:

  Select @IsResponseDoc

or by selecting the names of the response forms like so:

  Select Form =
"the name of your response document you want to show"
& form =
"Another form that is a response document"


Can you make a popup calendar in Notes?

Put the following into text field and it will generate a calendar in your form. Make sure that the text area uses a fixed width font.

REM "Controllable spacing version from MStevenson@symantec.com";

TmpDate := @Date(@Today);

REM "HSP controls the horizontal size of the calendar.";
REM "Use 1 space for a really small calendar.";
REM "Default is 2 spaces.";
hsp := "  ";

REM "VSP controls the vertical size of the calendar";
REM "Default is 1 @Newline";
vsp := @Newline;

REM "DSP is used for the day headings";
dsp := hsp + " ";

REM "-------------------------- Calculate the days for this month";
A := @Adjust(TmpDate; 0; 0; -(@Day(TmpDate) - 1); 0; 0; 0);
A1 := @Weekday(A);
A2 := A;
A3 := @Month(A);
C1 := @Adjust(A2; 0; 0; (1 - A1); 0; 0; 0);
C2 := @Adjust(A2; 0; 0; (2 - A1); 0; 0; 0);
C3 := @Adjust(A2; 0; 0; (3 - A1); 0; 0; 0);
C4 := @Adjust(A2; 0; 0; (4 - A1); 0; 0; 0);
C5 := @Adjust(A2; 0; 0; (5 - A1); 0; 0; 0);
C6 := @Adjust(A2; 0; 0; (6 - A1); 0; 0; 0);
C7 := @Adjust(A2; 0; 0; (7 - A1); 0; 0; 0);
C8 := @Adjust(A2; 0; 0; (8 - A1); 0; 0; 0);
C9 := @Adjust(A2; 0; 0; (9 - A1); 0; 0; 0);
C10 := @Adjust(A2; 0; 0; (10 - A1); 0; 0; 0);
C11 := @Adjust(A2; 0; 0; (11 - A1); 0; 0; 0);
C12 := @Adjust(A2; 0; 0; (12 - A1); 0; 0; 0);
C13 := @Adjust(A2; 0; 0; (13 - A1); 0; 0; 0);
C14 := @Adjust(A2; 0; 0; (14 - A1); 0; 0; 0);
C15 := @Adjust(A2; 0; 0; (15 - A1); 0; 0; 0);
C16 := @Adjust(A2; 0; 0; (16 - A1); 0; 0; 0);
C17 := @Adjust(A2; 0; 0; (17 - A1); 0; 0; 0);
C18 := @Adjust(A2; 0; 0; (18 - A1); 0; 0; 0);
C19 := @Adjust(A2; 0; 0; (19 - A1); 0; 0; 0);
C20 := @Adjust(A2; 0; 0; (20 - A1); 0; 0; 0);
C21 := @Adjust(A2; 0; 0; (21 - A1); 0; 0; 0);
C22 := @Adjust(A2; 0; 0; (22 - A1); 0; 0; 0);
C23 := @Adjust(A2; 0; 0; (23 - A1); 0; 0; 0);
C24 := @Adjust(A2; 0; 0; (24 - A1); 0; 0; 0);
C25 := @Adjust(A2; 0; 0; (25 - A1); 0; 0; 0);
C26 := @Adjust(A2; 0; 0; (26 - A1); 0; 0; 0);
C27 := @Adjust(A2; 0; 0; (27 - A1); 0; 0; 0);
C28 := @Adjust(A2; 0; 0; (28 - A1); 0; 0; 0);
C29 := @Adjust(A2; 0; 0; (29 - A1); 0; 0; 0);
C30 := @Adjust(A2; 0; 0; (30 - A1); 0; 0; 0);
C31 := @Adjust(A2; 0; 0; (31 - A1); 0; 0; 0);
C32 := @Adjust(A2; 0; 0; (32 - A1); 0; 0; 0);
C33 := @Adjust(A2; 0; 0; (33 - A1); 0; 0; 0);
C34 := @Adjust(A2; 0; 0; (34 - A1); 0; 0; 0);
C35 := @Adjust(A2; 0; 0; (35 - A1); 0; 0; 0);
C36 := @Adjust(A2; 0; 0; (36 - A1); 0; 0; 0);
C37 := @Adjust(A2; 0; 0; (37 - A1); 0; 0; 0);

REM "----------------------------------- Create display values";
B1 := @If(@Month(C1) != A3; "  "; @Right("0" + @Text(@Day(C1)); 2));
B2 := @If(@Month(C2) != A3; "  "; @Right("0" + @Text(@Day(C2)); 2));
B3 := @If(@Month(C3) != A3; "  "; @Right("0" + @Text(@Day(C3)); 2));
B4 := @If(@Month(C4) != A3; "  "; @Right("0" + @Text(@Day(C4)); 2));
B5 := @If(@Month(C5) != A3; "  "; @Right("0" + @Text(@Day(C5)); 2));
B6 := @If(@Month(C6) != A3; "  "; @Right("0" + @Text(@Day(C6)); 2));

REM "These days always have values, so do not bother with the extra check";
B7 :=  @Right("0" + @Text(@Day(C7)); 2);
B8 := @Right("0" + @Text(@Day(C8)); 2);
B9 := @Right("0" + @Text(@Day(C9)); 2);
B10 := @Right("0" + @Text(@Day(C10)); 2);
B11 := @Right("0" + @Text(@Day(C11)); 2);
B12 := @Right("0" + @Text(@Day(C12)); 2);
B13 := @Right("0" + @Text(@Day(C13)); 2);
B14 := @Right("0" + @Text(@Day(C14)); 2);
B15 := @Right("0" + @Text(@Day(C15)); 2);
B16 := @Right("0" + @Text(@Day(C16)); 2);
B17 := @Right("0" + @Text(@Day(C17)); 2);
B18 := @Right("0" + @Text(@Day(C18)); 2);
B19 := @Right("0" + @Text(@Day(C19)); 2);
B20 := @Right("0" + @Text(@Day(C20)); 2);
B21 := @Right("0" + @Text(@Day(C21)); 2);
B22 := @Right("0" + @Text(@Day(C22)); 2);
B23 := @Right("0" + @Text(@Day(C23)); 2);
B24 := @Right("0" + @Text(@Day(C24)); 2);
B25 := @Right("0" + @Text(@Day(C25)); 2);
B26 := @Right("0" + @Text(@Day(C26)); 2);
B27 := @Right("0" + @Text(@Day(C27)); 2);
B28 := @Right("0" + @Text(@Day(C28)); 2);
B29 := @Right("0" + @Text(@Day(C29)); 2);

B30 := @If(@Month(C30) != A3; "  "; @Right("0" + @Text(@Day(C30)); 2));
B31 := @If(@Month(C31) != A3; "  "; @Right("0" + @Text(@Day(C31)); 2));
B32 := @If(@Month(C32) != A3; "  "; @Right("0" + @Text(@Day(C32)); 2));
B33 := @If(@Month(C33) != A3; "  "; @Right("0" + @Text(@Day(C33)); 2));
B34 := @If(@Month(C34) != A3; "  "; @Right("0" + @Text(@Day(C34)); 2));
B35 := @If(@Month(C35) != A3; "  "; @Right("0" + @Text(@Day(C35)); 2));
B36 := @If(@Month(C36) != A3; "  "; @Right("0" + @Text(@Day(C36)); 2));
B37 := @If(@Month(C37) != A3; "  "; @Right("0" + @Text(@Day(C37)); 2));

ShowMonth := @Select(@Month(A2); "January"; "February";
 "March"; "April"; "May"; "June"; "July"; "August";
 "September"; "October"; "November"; "December");

REM "---------------------- Display the calendar";
sp + sp + sp + ShowMonth + " " + @Text(@Day(TmpDate)) + ", " + @Text(@Year(A2)) + vsp +

" " + "S" + dsp + "M" + dsp + "T" + dsp + "W" + dsp + "T" + dsp + "F" + dsp + "S" + vsp +
B1 + hsp + B2 + hsp + B3 + hsp + B4 + hsp + B5 + hsp + B6 + hsp + B7 + vsp +
B8 + hsp + B9 + hsp + B10 + hsp + B11 + hsp + B12 + hsp + B13 + hsp + B14 + vsp +
B15 + hsp + B16 + hsp + B17 + hsp + B18 + hsp + B19 + hsp + B20 + hsp + B21 + vsp +
B22 + hsp + B23 + hsp + B24 + hsp + B25 + hsp + B26 + hsp + B27 + hsp + B28 + hsp + vsp +
B29 + hsp + B30 + hsp + B31 + hsp + B32 + hsp + B33 + hsp + B34 + hsp + B35 + hsp + vsp +
B36 + hsp + B37


How do you prevent people from pasting documents into a database?

This uses a bug/feature in the Paste/Mail macro. Basically, the feature is that a Paste/Mail macro will prevent documents that do not match the selection criteria from being pasted into the database. When documents are mailed in, the docs are placed in the database and then the macro processes the documents that meet the selection criteria. Thus to prevent everyone from pasting documents into the database, you would create a paste/mail macro with the formula:

SELECT @False

This would prevent everyone from pasting. Of course, this uses up your paste/mail macro (one per database).


How do you generate a subset of list values based on the contents of another list?

This is useful for getting a subset of roles based on what state a document's workflow is in.

REM "From Damien Katz @ Unity Consulting"
tList1 :=tList1;
tList2 := tList2;
tItemsToKeep :=tItemsToKeep;
REM "Set variable tList1 to the list of values you want scan.";
REM "Set variable tList2 to corresponding list of values that you want to keep.";
REM "Set tItemsToKeep to the values you want ton scan list1 for.";
REM "tFilteredList returns the values from List2 that are kept";

REM "**************************Begin Function";
tListLength := @Elements( tList2);

tDigits := "0" : "1" : "2" : "3" : "4" : "5" : "6" : "7" : "8" : "9";

tNumbers :=  @Subset( @If( tListLength  <= 10; tDigits; tListLength >= 100;  tDigits *+ tDigits; tDigits *+ tDigits *+ tDigits); tListLength ) + "$$";

tMixedListWithNumbers := @Replace( tNumbers *+ tItemsToKeep ; tNumbers + tList1; tNumbers + tList2);
tMixedListWithoutNumbers := @Right( tMixedListWithNumbers; "$$");
tFilteredList := @Trim( @Replace( tMixedListWithoutNumbers ; tItemsToKeep ; ""));
REM "**************************End Function";


How do you open a document in edit mode if it exists?

This example looks up a document and opens it in edit mode if it exists. Otherwise, it composes a new document.

"INFO" represents any fields that are required for inheritance to new docs. You need to do the validation in the button because validation formulas will not be executed when a button is pushed.

BailOut:=@If(INFO="";  @Return(@Prompt([OK];"INFO Required";
   "Please enter INFO before proceeding."));"");

You can use a number of other BailOut statements to check for other required items. When opening multiple windows it's usually wise to save. It is also required to save in case the lookup fails and you need to create a response.
Remember that this will trigger all translation and validation formulas:

Save:=@If(@IsNewDoc;@Command([FileSave]);"");

"KeyStuff" is used to identify a particular document.

Key:=@Text(@DocumentUniqueID)+KeyStuff;

"DATA" is whatever you are looking up. In this case it is used to verify that what you're looking for exists.

Doc:=@DbLookup("":"NoCache";"";"(LookupView)";Key;"DATA");
Exists:=@If(@IsError(Doc);@False;@IsMember(KeyStuff;Doc));

If you found the right doc:
1) Open the view and go to the doc you found.
2) Put the doc in edit mode.
3) Switch back to the view window and close it.
Otherwise, compose a new one.

@If(Exists;
 @Do(@Command([OpenView];"(LookupView); Key); 
 @Command([EditDocument]; "0");
 @Command([OpenView]; "(LookupView)");
 @Command([FileCloseWindow]));
@Command([Compose]; Frm))

How do you create mailing labels in Notes?

The Lotus Approach database program has built-in support for Avery labels and can read from a Notes database directly.

Intelliprint from CSS can print labels from Notes views.

NotesToPaper by SoftVision Development.

[email] Ulrich-Krause posted this example of using OLE Automation to create labels in MS Word:

Sub Click(Source As Button)
  ' This is how you call it from a view (it uses all documents in the view)
  Call CreateMailingLabels("Subject","Subject","Subject","Subject","Subject")
End Sub


Sub CreateMailingLabels(Line1Fields As Variant,Line2Fields As Variant,Line3Fields As Variant,Line4Fields As Variant,Line5Fields As Variant)
  ' requires MS Word 97 or Word 2000
  ' works on any Notes view or folder
  ' supply list of Notes field names to be concatenated onto each line of the
  ' label in the parameters Line1Fields etc
  '
  ' e.g.
  '
  ' Call CreateMailingLabels_
  '   ("FirstName,LastName","HouseNo,Street","Town","County","PostCode")

  On Error Goto ErrorProc

  ' declare Notes back-end objects
  Dim session As New notessession
  Dim db As notesdatabase
  Dim doc As NotesDocument
  Dim dc As NotesDocumentCollection 
  Set db = session.currentdatabase
  Dim settings As NotesDocument
  Set settings=db.GetProfileDocument("Settings","")

  ' declare Notes front-end objects 
  Dim ws As New NotesUIWorkspace 

  Set dc=db.UnProcessedDocuments

  ' Find out active Notes view
  Dim view As NotesView
  Dim UIView As NotesUIView
  Set view = UIView.View

  ' declare constants

  wdCell = 12 'Microsoft Word VBA constant. Designates unit for table cell.
  wdLine=5
  wdCustomLabelA4 = 2
  cr = Chr(13) & Chr(10) ' Carriage return.

  SelectedDocuments=Messagebox("Do you want to use all the addresses in this view?",35,db.Title) 
  If SelectedDocuments=2 Then
    Messagebox "Merge Cancelled",16,db.Title
    Exit Sub
  End If

  If SelectedDocuments=7 Then
    TickBased%=True
  End If
  ' get required template from user

  LabelTemplate = Inputbox("Please enter the MS Word mailing label name to use. ", db.Title,"Avery L7413")

  ' trim off "Avery" prefix if used 
  LabelTemplateName=LabelTemplate 
  If Left$(LabelTemplate,5)="Avery" Then
    LabelTemplate=Trim$(Right$(LabelTemplate,Len(LabelTemplate)-5))
  End If
  If Instr(LabelTemplate,"-")>1 Then
     LabelTemplate=Trim$(Left$(LabelTemplate,Instr(LabelTemplate,"-")-1))
  End If
  If LabelTemplate="" Then
    Messagebox "Merge Cancelled",16,db.Title
    Exit Sub
  End If

  ' Create an instance of Excel
  Dim wrd As Variant 
  Set wrd = CreateObject("word.application")

  ' create a new Word document only if required 
  If wrd.documents.count=0 Then
    Call wrd.documents.add 
  End If

  ' create new mailing lanels 
  Print "Generating ";LabelTemplateName;" mailing labels in MS Word"
  On Error Goto TrapTemplateName 
  Call wrd.MailingLabel.CreateNewDocument(LabelTemplate)
  On Error Goto ErrorProc

  ' create each mailing label from line of Notes view

  LabelCount!=0
  If TickBased% Then
    Set doc=dc.GetFirstDocument
  Else
    Set doc=view.GetFirstDocument 
  End If
  While Not doc Is Nothing

    ' build label text

    LabelAddress = GetListFieldValues(doc,Line1Fields) & cr
    LabelAddress = LabelAddress & GetListFieldValues(doc,Line2Fields) & cr
    LabelAddress = LabelAddress & GetListFieldValues(doc,Line3Fields) & cr
    LabelAddress = LabelAddress & GetListFieldValues(doc,Line4Fields) & cr
    LabelAddress = LabelAddress & GetListFieldValues(doc,Line5Fields)

    If Not SingleColumn% Then
      Call wrd.Selection.TypeText(LabelAddress) ' Insert full address into Word.
      On Error Goto TrapSingleColumn
      Call wrd.Selection.MoveRight(wdCell) ' Move one cell to the right. 
      On Error Goto ErrorProc
      If SingleColumn% Then
        Call wrd.MailingLabel.CreateNewDocument(LabelTemplate,LabelAddress) 
      End If
    Else
      Call wrd.MailingLabel.CreateNewDocument(LabelTemplate,LabelAddress) 
    End If
    LabelCount!=LabelCount!+1
    If TickBased% Then
      Set doc = dc.GetNextDocument(doc)
    Else
      Set doc = view.GetNextDocument(doc)
    End If
  Wend
  If TickBased% Then
    Print LabelCount!;" labels created from selected addresses" 
  Else
    Print LabelCount!;" labels created from this Notes view (";SheetTitle$;")"
  End If
  REM Make the instance visible to the user
  wrd.visible = True

Exit Sub

TrapTemplateName:
  Messagebox "Incorrect Template Name",16,db.Title
  Exit Sub

TrapSingleColumn:
  Print "Detected non-table labels and changing behaviour accordingly" 
  SingleColumn%=True
  Resume Next
  ErrorProc:
  Print "(";Erl;") ";Error$
  Resume Next

End Sub


Function GetListFieldValues(doc As NotesDocument, FieldList As Variant) As String
  Dim TempList As String
  Dim TempOutput As String
  Dim TempArray As Variant
  Dim ThisField As String

  TempList=FieldList
  TempOutput=""
  If TempList<>"" Then
    ' parse list of fields 
    While Len(TempList)>0
      If Instr(TempList,",")>0 Then
        ThisField=Trim(Left$(TempList,Instr(TempList,",")-1))
        TempList=Right$(TempList,Len(TempList)-Instr(TempList,","))
      Else
        ThisField=Trim(TempList)
        TempList=""
      End If
      ' retrieve notes field 
      If Instr(ThisField,"(")>0 And Instr(ThisField,")")>0 Then
        ThisFieldTemp$=Right$(ThisField,Len(ThisField)-Instr(ThisField,"("))
        ThisFieldIndex%=Val(Left$(ThisFieldTemp$,Len(ThisFieldTemp$)-1))
        ThisField=Left$(ThisField,Instr(ThisField,"(")-1)
      Else
        ThisFieldIndex%=-1
      End If
      TempArray=doc.GetItemValue(ThisField)
      If ThisFieldIndex%>=0 Then
        If Ubound(TempArray)>=ThisFieldIndex% Then 
          TempOutput=TempOutput+" "+TempArray(ThisFieldIndex%)
        End If
      Else
        TempOutput=TempOutput+" "+TempArray(0) 
      End If
    Wend
  End If
  GetListFieldValues=TempOutput
End Function


How do you set up a database to provide a menu when it is opened?
Create your default view with a selection formula: Form = Menu. Sort it by a hidden field called Sequence. Make one visible field with the formula: MenuText. Assign a large bold font in a pretty color to that column.
Create a form called Menu, and design it to have two fields: Sequence (numeric) and MenuText (text). Hide all these fields when reading. Add a rich text field that is not hidden. In the Form Attributes dialog, be sure to specify that this form is not to be displayed on the Compose menu.
Create a macro that allows you (or other database designers) to compose Menu docs. Compose Menu docs that give your users the following default view:

Welcome to NiftyApp! This is the Main Menu.

Double-click on your selection:

Compose Nifty Doc

View Nifty Things

etc. Compose some Menu docs with blank MenuText fields to space things nicely. In the rich text fields of the Menu docs, put in text that describes available choices, such as Push here to compose a Nifty Widget, and buttons with formulas that execute that action. You can hide all forms and views from Notes menus, leaving the only available choice on the View menu Nifty App Main Menu.

Is it possible to move response documents to refer to a different parent document?

You can lookup DocumentIDs and put them into $REF. The trick is not using any intermediaries or holding places (i.e. temporary variables, environmental variables, view columns). You have to set it directly equal to the results of @DbLookup. You are right, $REF is a special data type, called 'Response Reference List'.

Let's say that you want to reassign the $REF field of a series of response documents, based on some key that the new parents share with the documents that will be their new children (let's call this field 'keyValue' which exists in both potential parent and response). Create a view, call it 'Parents by keyValue'. The selection formula should select only the potential parents, and the first sorted column should be the keyValue field (you don't need to add any other columns). Now run the following macro on all the documents in this view:

  FIELD parentID := @DocumentUniqueID;

This parentID field now holds the parent's DocumentID and is the special data type 'Response Reference List'. Note: do not create a parentID field in your form; this field is created on-the-fly by the macro.

Now create a view called 'Responses', which selects only the potential children (make sure the View Attribute 'No Response Hierarchy' is set). Run the following macro on all of the documents in this view:

  FIELD $REF := @DbLookup("":"NoCache"; ""; "Parents by keyValue"; keyValue; "parentID");

You've successfully reset the $REF field. If there is no keyValue, and there is no way to set one effectively, then you can reset the $REF field by cutting a potential response, highlighting the new parent and pasting it 'onto' the new parent.


How do you sum a numberlist?

Divide and Conquer Method

Have you tried adding two list of numbers together? 1:1:1:1 + 1:1:1:1 = 2:2:2:2. Now lets split the resultant list and add the two list together. 2:2 + 2:2 = 4:4. Now do it again. 4 + 4 = 8. So if you start with the list 1:1:1:1:1:1:1:1 and use this process you would get your answer of 8. That's all there is to it. Obviously your list has to contain a number of elements equal to a power of 2. That's the first thing to fix.
There is a self imposed limit of 8192 elements that can be added together. The formula can be extended to add together millions of elements but there must always be a limit. 8192 was chosen for two reasons: 1) A number takes 8 bytes in LN; a lookup can only return 64k, therefore only 8192 numbers will fit into 64k. 2) A field on a form has the same limit.
Put the list in a field called values and pass it to the formula:
list := 0;
adjust := 0;
elem := @Elements(values);

@If(elem = 1; @Return(values); elem > 8192; 
        @Do(@Prompt([OK]; "Error"; "Number of elements to add exceeded 8192"); 
@Return("")); "");
f := @Power(2; @Integer((@Log(elem) / @Log(2))));
@Set("adjust"; elem - f);
@If(adjust = 0; @Set("list"; values); 
        @Do(@Set("list"; ((@Subset(values; adjust) + @Subset(values; -adjust)) : @Subset(@Subset(values; f); adjust - f)))));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Subset(list; f) + @Subset(list; -f))))); @Return(list));
list

Use a Math Library
There is a math library that has a sum function which is hooked in via @dblookup. Click [ftp] here to download it. Notes 4.0 will also have a built-in @sum function.

How do you insert a new line in a Rich Text field using a macro?

@Command([EditInsertText]; @Char(0))

Instead of using @Char(0), you can also use @Newline.


Why do images cut/pasted from Notes come out black?
There is a bug in Notes where it sometimes doesn't save the palette. The guaranteed way to force Notes to keep the palette is to import an image in PCX or TIFF formats.

How do you access a specific element of a multi-value field?

To extract element 'n' from the field "Choices":

  @Subset(@Subset(Choices;n); -1)


How do you track document modifications?
This will result in a rolling list of the most recent five modifications. You have to add 3 fields at the bottom of a page make sure they're all multivalue.

Computed Field called "fdEhRev" to count Number of Revisions; Formula:

@V2If(@IsDocBeingSaved; @V2If(fdEhRev = ""; 0; (@Subset(fdEhRev; 1) + 1) : @V2If(@Elements(fdEhRev) > 4; @Subset(fdEhRev; 4); fdEhRev)); @IsNewDoc; ""; fdEhRev)

Computed Field called "fdEhEditor" to list last editor's name; Formula:

@V2If(@IsDocBeingSaved; @V2If(fdEhEditor = ""; @UserName; @UserName : @V2If(@Elements(fdEhEditor) > 4; @Subset(fdEhEditor; 4); fdEhEditor)); @IsNewDoc; ""; fdEhEditor)

Computed Field called "fdEhDate" to list date edited; Formula:

@V2If(@IsDocBeingSaved; @V2If(fdEhDate = "";  @Now; @Now : @V2If(@Elements(fdEhDate) > 4;  @Subset(fdEhDate; 4); fdEhDate)); @IsNewDoc; ""; fdEhDate)

How do you track who changed a critical field?

If you want to add an audit trail of the modifications made to a critical field named "PRIORITY" it can be done with the following:
1) Create a duplicate "PRIORITY" field (named "PRIORITYDelta") that is hidden and has in its input translation formula a statement to store the contents of the PRIORITY field. This will retain the contents of the priority field before editing in a current session.
2) Create a multi-value field ("Updatesto") with a formula that compares PRIORITY to PRIORITYDelta when the document is being saved and when the condition is right (i.e. PRIORITY != PRIORITYDelta) attaches the new save information to the field:

feed := @Name([CN]; @V3UserName) + " on " + @Text(@Date(@Now)) + " at " + @Text(@Time(@Now)) + "     " +  PRIORITY;
FIELD Updatesto := @If(@IsDocBeingSaved & PRIORITY != PRIORITYDelta ; Updatesto : feed; Updatesto);
Updatesto

Note that the Revision field (Updatesto) needs to before PRIORITYDelta Field on the form for the revision field to keep a change history.


How do you convert a numerical value to the equivalent written text?
To convert a field called origNumber to written text, use the field formula:

REM "Thanks to MStevenson@symantec.com for updating this for negative numbers";

REM "Get numerical value";
origNumber := <numerical value>;

REM "Convert negative to positive";
NUMBER := @If(origNumber = "";0;origNumber < 0;-origNumber;origNumber);

REM "Test range";
@If(NUMBER > 999999999999999; @Return("Quadrillion Plus!"); "");

REM "Parse, format fixed with 2 decimals";
money := @Text(NUMBER; "F2");
c := @Word(money; "."; 2);
d := @Right("000000000000000" + @Word(money; "."; 1); 15);

REM "Constants";
n := "" : "One" : "Two" : "Three" : "Four" : "Five" : "Six" : "Seven" :
 "Eight" : "Nine" : "Ten" : "Eleven" : "Twelve" : "Thirteen" :
 "Fourteen" : "Fifteen" : "Sixteen" : "Seventeen" : "Eighteen" :
 "Nineteen";
m := "" : "" : "Twenty " : "Thirty " : "Forty " : "Fifty " : "Sixty " :
 "Seventy " : "Eighty " : "Ninety ";

REM "Ones";
d0 := @Middle(d; 12; 3);
h0 := @Subset(@Subset(n; @TextToNumber(@Left(d0; 1)) + 1); -1);
v0 := @TextToNumber(@Right(d0; 2));

t0 := @Trim(@If(h0 = ""; ""; h0 + " Hundred ") + @Subset(@Subset(m; 
 1 + @TextToNumber(@Middle(d0; 1; 1))); -1) + @Subset(@Subset(n;
 @If(v0 > 19; @TextToNumber(@Right(d0; 1)); v0) + 1); -1));

REM "Thousands";
d1 := @Middle(d; 9; 3);
h1 := @Subset(@Subset(n; @TextToNumber(@Left(d1; 1)) + 1); -1);
v1 := @TextToNumber(@Right(d1; 2));

t1 := @Trim(@If(h1 = ""; ""; h1 + " Hundred ") + @Subset(@Subset(m; 
 1 + @TextToNumber(@Middle(d1; 1; 1))); -1) + @Subset(@Subset(n; 
 @If(v1 > 19; @TextToNumber(@Right(d1; 1)); v1) + 1); -1));

REM "Millions";
d2 := @Middle(d; 6; 3);
h2 := @Subset(@Subset(n; @TextToNumber(@Left(d2; 1)) + 1); -1);
v2 := @TextToNumber(@Right(d2; 2));

 t2 := @Trim(@If(h2 = ""; ""; h2 + " Hundred ") + @Subset(@Subset(m; 
 1 + @TextToNumber(@Middle(d2; 1; 1))); -1) + @Subset(@Subset(n; 
 @If(v2 > 19; @TextToNumber(@Right(d2; 1)); v2) + 1); -1));

REM "Billions";
d3 := @Middle(d; 3; 3);
h3 := @Subset(@Subset(n; @TextToNumber(@Left(d3; 1)) + 1); -1);
v3 := @TextToNumber(@Right(d3; 2));

t3 := @Trim(@If(h3 = ""; ""; h3 + " Hundred ") + @Subset(@Subset(m;
 1 + @TextToNumber(@Middle(d3; 1; 1))); -1) + @Subset(@Subset(n; 
 @If(v3 > 19; @TextToNumber(@Right(d3; 1)); v3) + 1); -1));

REM "Trillions";
d4 := @Left(d; 3);
h4 := @Subset(@Subset(n; @TextToNumber(@Left(d4; 1)) + 1); -1);
v4 := @TextToNumber(@Right(d4; 2));

t4 := @Trim(@If(h4 = ""; ""; h4 + " Hundred ") + @Subset(@Subset(m;
 1 + @TextToNumber(@Middle(d4; 1; 1))); -1) + @Subset(@Subset(n;
 @If(v4 > 19; @TextToNumber(@Right(d4; 1)); v4) + 1); -1));

REM "Put it together";
@If(origNumber = "";"";origNumber < 0;"Negative ";"") + @Trim(@If(t0 +
 t1 + t2 + t3 + t4 = ""; "Zero"; @If(t4 = ""; ""; t4 + " Trillion ") +
 @If(t3 = ""; ""; t3 + " Billion ") + @If(t2 = ""; ""; t2 + " Million") +
 @If(t1 = ""; ""; t1 + " Thousand ") + t0)) + " Dollars and " +
 @If(c = ""; "00"; c) + " Cents"

How do I remove erased fields that keep appearing in the Add Fields window?

From Ron Heller (hellerr@msnotes.wustl.edu):

1. Run an agent to remove the erased field's data from all documents.
  FIELD oldField1 := @Unavailable; 
  Select @ALL

2. Then, you need to remove the field from ALL forms and views; do a Design Synopsis to make sure.

3. When you delete a field on a form, always do it by clicking to the right of it and doing a backspace. You should get a prompt asking if you want to delete the field. If you just select the field and press delete, you get no prompt, and the field is not deleted from the UNK.

My experience has been that there are other ways to get the field "properly" deleted, but the key is that, if you are prompted if it's OK to delete the field, you did it properly; if you are NOT prompted, you did
not.

4. Then (and this is the one most often forgotten), if the db has a Full Text Index, you MUST DELETE IT BEFORE compacting the db.

5. Then compact the db.

The above steps work about 80-90% of the time.

If not, here's an optional step we'll call 2a, which you can do before steps 3 and 4 (also from Mark Darrah):
"You must now get rid of the field's "ghosts" from all the forms. There are several ways to do this.
a. Create a new blank form. Now take each of your existing forms in design mode, and copy and paste the entire form contents into the new blank form. Repeat for each form in the database. Then delete the old forms and rename the new ones. Be aware that although this is the easiest method, I have had problems with tab settings and hide-whens getting screwed up. Double check all settings when done. Also, you'll need to copy all your form events if any, and the window title formulas.
b. Another method is to add the field back into the form temporarily (just create a new field and name it as the old field). Now do the delete as described above by clicking to the right and doing a backspace. You should get the prompt."


How do you retrieve a column total for a category?

As it turns out, @DbColumn will return totals and subtotals on categories, and not the individual line items. Therefore, if you have the correct hidden view, you don't have to resort to that lengthy @Sum at all!!

Case in point:

Apples 16
Red 10
Green 6
Oranges 22
Juicy 11
Firm 10
Mandarin 1
Bananas
13
Big 13
51

If you want to retrieve that 22 from the hidden view, don't use @DbLookup (which will return 11;10;1), instead use 2 @DbColumns:

x:="Oranges"; Usually you use an @Prompt to get this value
a:=@DbColumn("";"";"(Fruit Count)";1); Returns "Apples":"Oranges":"Bananas"
b:=@DbColumn("";"";"(Fruit Count)";3); Returns 16:22:13:51
c:=@Member(x;a); Look for where Oranges appears in the list (2nd)
d:=@If(c=0;-1;c); @Subset crashes if it sees a 0, so this is to prevent that
e:=@Subset(@Subset(b;d);-1); Select the proper (2nd) item out of the number list (22)
@If(c=0;"No Match";e) Other half of @Subset workaround, returns 22, the proper answer.


Are Dates Calculated on the Server or Workstation?

For views, it's easy. Views are executed by the server so everything comes from the server, including @username and other functions that trip people up. For other date and time fields though, it is very confusing. Here is a breakdown on date calculations elsewhere:

"Date Field Types" are mainly responsible for where the date will be generated.

1. When the Date fields are Editable: @Created: 11/02/93 02:25:02 AM
@Now: 11/02/94 02:29:57 PM
@Today: 11/02/94
@Yesterday:11/01/94
@Tomorrow:11/03/94
@Modified: 11/02/93 02:29:50 AM
@Accessed 11/02/93 02:29:50 AM
Result:
a) @Created, @Modified, @Accessed come from the server.
b) @Now, @Today, @Yesterday, @Tomorrow come from the workstation.
c) First time @Modified date comes from the workstation.

2. When the Date fields are Computed: @Created: 11/02/93 02:27:46 AM
@Now: 11/02/94 02:29:48 PM
@Today: 11/02/94
@Yesterday:11/01/94
@Tomorrow:11/03/94
@Modified: 11/02/93 02:30:13 AM
@Accessed 11/02/93 02:28:43 AM
Result:
a) @Created, @Modifies, @Accessed come from the server.
b) @Now, @Today, @Yesterday, @Tomorrrow come from the workstation.
c) First time @Modified date comes from the workstation.

3. When the Date fields are Computed for display:@Created: 11/02/93
02:33:16 AM
@Now: 11/02/94 02:38:36 PM
@Today: 11/02/94
@Yesterday:11/01/94
@Tomorrow:11/03/94
@Modified: 11/02/93 02:35:07 AM
@Accessed 11/02/93 02:35:07 AM
Result:
a) @Created, @Modified, @Accessed come from the server.
b) @Now, @Today, @Yesterday, @Tomorrow come from the workstation.
c) First time @Modified date comes from the workstation.

4. When the Date fields are Computed when composed: @Created:
11/02/93 02:35:38 AM
@Now: 11/02/94 02:34:13 PM
@Today: 11/02/94
@Yesterday:11/01/94
@Tomorrow:11/03/94
@Modified: 11/02/94 02:34:13 PM
@Accessed
Result:
a) @Created comes from the server.
b) @Now, @Today, @Yesterday, @Tomorrow and @Modified come from
the desktop.
c) @Accessed does not display.


How do you sort and categorize a view based on months in chronological order?

Insert a hidden column just to the left of your month column. Make this column contain a numeric @month type value that will sort correctly, then sort it. The hidden column should be sorted but not categorized, while the visible month column should be categorized.
If you have multiple years to cope with, use

  (@Year(TheDate)-1900)*12 + @Month(TheDate)

in the hidden column so that everything sorts nicely, or you can use an extra categorization on @Year to the left of the month.


Can a database log the number of times each document has been accessed?
Create a Mail-In Database to handle the logging. In the Window Title Formula of the database you want to monitor, place a @MailSend which has a subject that uniquely defines the document and sends the mail to the Mail-In Database.

Can you launch a URL without using InterNotes?

Put this formula in a button:

@Command([Execute]; "C:\\netscape\\netscape.exe"; "HTTP://www.xyzcorp.com")

Note that this will invoke netscape, so this form will not be cross-platform if you have other Notes clients.


How do you get the date for Easter of a given year?

REM "This formula returns the date of Easter day for the year of a given date D";
REM "Is valid until year 4000";
REM "Contributed from billingt@online.no";

D:=[30.07.97];
Year:=@Year(D);

c:=@Integer(Year/100);
n:=Year-19*@Integer(Year/19);
k:=@Integer((c-17)/25);
i:=c-@Integer(c/4)- @Integer((c-k)/3)+19*n+15;
ii:=i-30*@Integer(i/30);
iii:=ii-@Integer(ii/28)*(1-@Integer(ii/28)*@Integer(29/(ii+1))*@Integer((21-n)/11));

j:=Year+@Integer(Year/4)+iii+2-c+@Integer(c/4);
jj:=j-7*@Integer(j/7);
l:=iii-jj;
EasterMonth:=3+@Integer((l+40)/44);
EasterDay:=l+28-31*@Integer(EasterMonth/4);
@Date(Year;EasterMonth;EasterDay);

How much information can an @Db Function return?
Approximately 42,000 bytes. Attempting to return more than this results in the error message, "Paragraph or Field Cannot be Larger Than 64k Bytes." Header information fills the difference between 42,000 and 64k (about 65,000).

How do you avoid error messages with DBLookup?

TempVar := @DbLookup();
@If(@IsError(TempVar); 'perform desired error response'; 'perform desired
action on TempVar')

TempVar is used to hold the results and will also hold the special "error" value for comparison.


How do you find the elements which are unique to a list?

This will get the elements which are unique to List B:

UniqueToB:= @Trim( @Replace( ListB, ListA, ""))


How do signatures and sections in a form work?
A section will be signed if a field within it is edited, and that field is marked for signing when saved within a section. Sections aren't really signed at all - the field is - but the client notices the field's inside a section and makes it look like the section was signed. Different sections can be signed by different people.

When saving, Notes will sign all sections to which the user has access - even if signed before by that user or someone else. So, if you want a section signed and that signature to last, you must change the section's access control list to deny permssion to anyone else that might edit the document. Even then, if the signatory edits some other part of the document, the section will get re-signed. To avoid this, it's probably possible to make the section editable by no-one.

Note that the section ACL appears to be just a textlist field in the actual document (i.e. all the section handling is part of the form handling), so permissions can be re-widened (and re-signature etc. re-enabled) from a macro.

What does the @Db NoCache parameter do?
NoCache means that every time the @Db Function is executed, it will look at the current state of the Lookup View. If you do not use NoCache, the @Db Function will default to Caching the Lookup View the first time it executes. For Lookup Views which do not change rapidly (minute by minute), you should allow Notes to Cache the Lookup View. The difference in performance is tremendous.

How do you generate unique document numbers?
Because of the nature of Notes database replication, there is no way to generate unique document numbers. What is normally done to give each document a unique key is to concatenate the users name or initials with the date, and the time of document creation. An example can be found in Lotus Notes Call Tracking Database example. Another example is below:

TimeNow := @Now;
YearString := @Right(@Text(@Year(TimeNow)); 2);
MonthString := @Select(@Month(TimeNow); "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; "10"; "11"; "12");
DayNumber := @Day(TimeNow);
DayString := @Select(DayNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09";  @Text(DayNumber));
HourNumber := @Hour(TimeNow);
HourString := @If(HourNumber = 0; "00"; @Select(HourNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(HourNumber)));
MinuteNumber := @Minute(TimeNow);
MinuteString := @If(MinuteNumber = 0; "00"; @Select(MinuteNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(MinuteNumber)));
SecondNumber := @Second(TimeNow);
SecondString := @If(SecondNumber = 0; "00"; @Select(SecondNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(SecondNumber)));
UniqueID := YearString + MonthString + DayString + HourString + MinuteString + SecondString + @Left(@Name([CN];@UserName); 1) + @MiddleBack(@Name([CN];@UserName); " "; 1)

Note that if this code is called twice, it doesn't take into account that there may be duplicate values. To prevent this case, you have to have a hidden view with all the unique numbers sorted. Then, do a @DbLookup to see if the value is already used.

For Notes 4 and above, you can use the @Unique function to get Notes' unique document ID.


How do you get all the people in a group in the N&A Book?

This solution will work even if groups are nested.

Macro 1 - TreeWalk (Once only)

SELECT @All;
@Command([ToolsRunMacro]; "TreeWalkInit");
@Command([ToolsRunMacro]; "TreeWalkIterate");
@Command([ToolsRunMacro]; "TreeWalkRecur")

Macro 2 - TreeWalkInit (Filter)
SELECT @All;
FIELD WorkList := Members;
FIELD People := "";
FIELD ChildGroups := ListName;

Macro 3 - TreeWalkIterate (Filter)
SELECT @All;
FIELD ListDescription := ListDescription;
FIELD People := People;
FIELD ChildGroups := ChildGroups;
REM;
REM "Check for end of recursion";
REM;
ToDo := @Text(@Elements(WorkList));
ENVIRONMENT TreeToDo := ToDo;
@If(ToDo = "0"; @Return(0); "");
REM;
REM "Get the next element in the to do list";
REM;
NextItem := @Subset(WorkList; 1);
REM;
REM "Modify the to do list";
REM;
FIELD WorkList := @If(ToDo = "1"; ""; @Subset(WorkList; -(@Elements(WorkList) - 1)));
REM;
REM "Skip if null next item";
REM;
@If(NextItem = ""; @Return(0); "");
REM;
REM "See if the item is an already processed group";
REM;
@If(@If(@Matches(ChildGroups; NextItem); @Do(@If(@Left(ListDescription; "**") = "RECURSIVE"; ""; @SetField("ListDescription"; "RECURSIVE**" + ListDescription)); @Return("quit")); "ok") = "quit"; @Return(0); "");
REM;
REM "See if in the list of people";
REM;
@If(@Matches(People; NextItem); @Return(0); "");
REM;
REM "See if the item is a person or a group";
REM;
ItemLookup := @DbLookup("" : ""; ""; "Groups"; NextItem; "Members");
REM;
REM "If error, then this is a person, else have the contents of the group";
REM;
@If(@IsError(ItemLookup); @SetField("People"; @If(People = ""; NextItem; People : NextItem)); @Do(@SetField("ChildGroups"; ChildGroups : NextItem); @SetField("WorkList"; WorkList : ItemLookup)))

Macro 4 - TreeWalkRecur (Once only)

SELECT @All;
REM;
REM "Check if should recur";
REM;
ToDo := @Environment("TreeToDo");
@If((ToDo = "0") | (ToDo = ""); @Return(0); "");
REM;
REM "Process one iteration";
REM;
@Command([ToolsRunMacro]; "TreeWalkIterate");
REM;
REM "Recur";
REM;
@Command([ToolsRunMacro]; "TreeWalkRecur")

How do you log off a Notes user so you can force user revalidation?

You can use the following @Command:

  @Command([ToolsUserLogoff])


How do you calculate the week number in a year of a given date?

This formula satisfies ISO 8601:1988:

REM "This formula satisfies ISO 8601:1988";
REM "Formulae updated : 08.28.1997 ";
REM "by Stephen P.R. Renton (sprenton@mcmail.com)";
REM "Version: 1.01";
REM "Tested on : Lotus Notes Release 4.5";

REM "D is the date of interest.";
D := @TextToTime(@Prompt([OKCANCELEDIT]; "Enter Date"; "Please enter a
date to convert to a week number:"; ""));
REM "D := [31/12/95]";

FirstOfYear := @Date(@Year(D); 1; 1);
LastOfYear := @Date(@Year(D); 12; 31);
FirstDayNum := @Weekday(FirstOfYear);
LastDayNum := @Weekday(LastOfYear);

REM "ISO weeks start on Monday and ends on Sunday.";
ISOFirstDayNum := @If(FirstDayNum = 1; 7; FirstDayNum - 1);
ISOLastDayNum := @If(LastDayNum = 1; 7; LastDayNum - 1);

REM "The first and last ISO week is the first";
REM "and last ISO week to include Thursday";
IsFirstWeek := 7 - ISOFirstDayNum > 2;
IsLastWeek := 7 - ISOLastDayNum < 4;
REM "The date of the first day of the first ISO week";
ISOFirstDay := @If(IsFirstWeek;
            @Adjust(FirstOfYear; 0; 0; 1 - ISOFirstDayNum; 0; 0; 0);
            @Adjust(FirstOfYear; 0; 0; 8 - ISOFirstDayNum; 0; 0; 0));
REM "The date of the last day of the last ISO week";
ISOLastDay := @If(IsLastWeek;
            @Adjust(LastOfYear; 0; 0; 7 - ISOLastDayNum; 0; 0; 0);
            @Adjust(LastOfYear; 0; 0; -ISOLastDayNum; 0; 0; 0));

REM "Date outside ISOFirstDay and ISOlastDay";
REM "are from the previous or next year";
REM "Return the ISO week number and exit";

FirstWeekNextYear := @If(D > ISOLastDay; @Return(@Prompt([OK]; "FWNY";
@Text(@Year(D)+1) + "W01")); NULL);

REM "I suspect this is where Julian dates would be useful";
REM "A recursive call could be used in a real language";
LastWeekLastYear := (D - @Adjust(FirstOfYear; -1; 0; 0; 0; 0; 0))/60/60/24/7;
AdjustLastWeek := 1 - (LastWeekLastYear - @Integer(LastWeekLastYear));
@Set("LastWeekLastYear"; LastWeekLastYear + AdjustLastWeek);
@If(D < ISOFirstDay;
@Return(@Prompt([OK]; "LWLY"; @Text(@Year(D) - 1) + "W" +
@Text(LastWeekLastYear))); NULL);

REM "If you get this far, the date falls into an ISO week this year";
REM "Convert the difference in seconds to weeks";
NumWeeks := (D - ISOFirstDay)/60/60/24/7;

REM "Fractions indicate that the date falls";
REM "in the middle of the ISO week";
WeekAdjust := 1 - (NumWeeks - @Integer(NumWeeks));
ISOWeekNum := NumWeeks + WeekAdjust;

REM "Conform to ISO 8601 format";
Pad:=@If(ISOWeekNum<10;"0";"");
Result := @Text(@Year(D))+"W"+Pad+@Text(ISOWeekNum);

@Prompt([OK];"Week number"; Result)

Here is another version that gives you a week number in another ISO format:

REM "Formulae Calculate the Week Number(01-53) for any Date. ";
REM "The output follows the ISO 8601:1988 standard: ex 1997-W31-4 for 1997.07.31 ";
REM "Formulae writer : Nikolai Aasen (nsaa@pvv.org), UNI Storebrand, Norway";
REM "Formulae written : 1997.07.30";
REM "Formulae updated : 1997.08.04";
REM "Version  : 1.03";
REM "Tested on   :Lotus Notes 4.6PreRelease2";
REM "This formulae is available in the";
REM "Lotus Notes FAQ: http://www.keysolutions.com/NotesFAQ/";
REM "More Calendar information in http://www.pip.dknet.dk/~pip10160/calendar.html"; 
REM "ISO 8601:1988 summary at: http://quake.stanford.edu/~lyle/ISOdate/Date.html";
REM "--------------------------------------------------------------------------------------------------";             
REM "Replace D with the date of interest.";
D := [1997.31.07];

REM "**************************";
REM"Calculate some data for this Year";
REM "**************************";
FirstOfYear := @Date(@Year(D); 1; 1);
LastOfYear := @Date(@Year(D); 12; 31);
FirstDayNum := @Weekday(FirstOfYear);
REM "ISO weeks start on Monday and ends on Sunday.";
ISOFirstDayNum := @If(FirstDayNum = 1; 7; FirstDayNum - 1);

REM " Week 1 of any year is the week that contains the first Thursday in January.";
REM "=1 if 1. jan = man - thu. WeekNumber is then 1, else 0";
IsFirstWeek := 7- ISOFirstDayNum >2;

REM "The first Monday after 1. jan this Year";
FirstMonday := 9 - ISOFirstDayNum;

REM "Number of Days from 1. jan to D";
DaysToDateD:=(D-FirstOfYear)/60/60/24+1;

REM "Number of days in Year(either 365 or 366)";
DaysInYear:=(LastOfYear-FirstOfYear)/60/60/24;

REM "Number of Weeks in Year. Most years have 52 weeks, but years that start on a 
Thursday and leapyears that start on a Wednesday have 53 weeks.";
NumberOfWeeksThisYear:=@If( (ISOFirstDayNum=4 | (ISOFirstDayNum=3 & 
DaysInYear=366));53;52 );

REM "***************************";
REM"Calculate some data for last Year  ";
REM "***************************";
FirstOfLastYear := @Date(@Year(D)-1; 1; 1);
LastOfLastYear := @Date(@Year(D)-1; 12; 31);
FirstDayNumLast := @Weekday(FirstOfLastYear);
REM "ISO weeks start on Monday and ends on Sunday.";
ISOFirstDayNumLast := @If(FirstDayNumLast = 1; 7; FirstDayNumLast - 1);

REM "Number of days in Year(either 365 or 366)";
DaysInYearLast:=(LastOfLastYear-FirstOfLastYear)/60/60/24;

REM "Number of Weeks Last Year. Most years have 52 weeks, but years that start on a 
Thursday and leapyears that start on a Wednesday have 53 weeks.";
NumberOfWeeksLastYear:=@If( (ISOFirstDayNumLast=4 | (ISOFirstDayNumLast =3 & 
DaysInYearLast=366));53;52 );

REM "************************";
REM"Calculates the Week Number  ";
REM "************************";


DDayNum := @Weekday(D);
ISODDayNum := @If(DDayNum = 1; 7; DDayNum - 1);

REM"Is D in the last Week of the last Year?";
DayInLastWeek := @If((DaysToDateD<FirstMonday & IsFirstWeek = 0);
                                @Return( @Text(@Year(D)-1)+"-W"+@Text(NumberOfWeeksLastYear)+"-"+@Text(ISODDayNum));
                                 NULL);

REM "Calculate number of Complete Weeks Between D and 1.jan";
ComplNumWeeks:=@Integer((DaysToDateD-FirstMonday)/7);

REM "Are there remaining days?";
RemainingDays:=@If( (DaysToDateD+1-(FirstMonday+7*ComplNumWeeks))>0);

NumWeeks:= IsFirstWeek+ComplNumWeeks+1;

Out :=
@If(RemainingDays;
@If( (NumWeeks>52 & NumWeeks>NumberOfWeeksThisYear );
         @Return(@Text(@Year(D)+1)+"-W01-"+ @Text(ISODDayNum));
          @Return(@Text(@Year(D))+"-W"+@Right("0"+@Text(NumWeeks);2)+"-"+@Text(ISODDayNum))); 
@Return(@Text(@Year(D))+"-W"+@Right("0"+@Text(NumWeeks-1);2) +"-"+@Text(ISODDayNum)));
Out

This LotusScript version comes from Christian Meis:

'CalculateWeekNumbers: 

Option Declare


Sub Initialize
     
%REM
This short agent shows how the calendar week
function can be implemented.

Christian Meis, 09.04.1999
E-Mail: Christian.Meis@mlc.de
%END REM
     
  Dim dateval As Variant
  Dim test As String
     
  dateval = Cdat( Inputbox( "Please enter date: " ) )
  test = GetCalendarWeek( dateval )
     
  Messagebox( Cstr( dateval ) & " --> " & test )
     
End Sub


Function GetCalendarWeek( Byval inputdate As Variant ) As String
     
%REM
This function calculates the calendar week number 
(ISO standard) for a given date value. The format
function of LotusScript (parameter "ww") does not solve 
this problem. 

Monday is the first day of the week. Week #1 is the week 
that contains the 4th of January (ISO 8601). The week at the
end/beginning of the year belongs to the next/previous year,
if there are 3 days or less of that week in the year in question.

Christian Meis, 4.2.2000
%END REM
     
  Dim InputDateOffset As Integer
  Dim YearInQuestion As Integer
  Dim January4 As Variant
  Dim January4Offset As Integer
  Dim FirstMondayOfYear As Variant
  Dim January1Offset As Integer
  Dim December31Offset As Integer
  Dim weeknum As Integer
     
  ' The year value is preset with that of the input date
  YearInQuestion = Year( inputdate )
     
  ' Calculate offset to monday from the input date
  InputDateOffset = CalculateIsoWeekday( inputdate )
     
  ' Calculate offsets for the first/last day of the year
  January1Offset = CalculateIsoWeekday( Cdat( "01.01." & Cstr( YearInQuestion ) ) )
  December31Offset = CalculateIsoWeekday( Cdat( "31.12." & Cstr( YearInQuestion  ) ) ) 
     
  ' If the input date is before the 4th of January and the year starts with
  ' a friday, saturday or sunday, the week belongs to the previous year
  ' if the entered date is not a monday or tuesday
  If Month( inputdate ) = 1 And Day( inputdate ) < 4 And January1Offset> 3 And InputDateOffset > 1 Then
    YearInQuestion = YearInQuestion - 1
  End If

  ' If the input date is after the 28th of December and the year ends with
  ' a monday, tuesday or wednesday, then the week belongs to the following year
  ' if the entered date is not a saturday or sunday
  If Month( inputdate ) = 12 And Day( inputdate ) > 28 And December31Offset < 3 And InputDateOffset < 5 Then
    YearInQuestion = YearInQuestion + 1
  End If
     
  ' The 4th of January defines week #1
  January4 = Cdat( "04.01." & Cstr( YearInQuestion ) )
     
  ' Offset to the monday of week #1 
  FirstMondayOfYear = Cdat( January4 - CalculateIsoWeekday( January4 ) )
     
  ' The time range between the monday of week #1 and the monday
  ' of the week in question is divided by 7, plus 1 for the first week
  weeknum = ( inputdate - InputDateOffset - FirstMondayOfYear ) \ 7 + 1
     
  ' The return value is a string with the week number and the year
  GetCalendarWeek = Cstr( weeknum ) & " " & Cstr( YearInQuestion )
     
End Function


Function CalculateIsoWeekday( tmpdate As Variant ) As Integer
     
%REM
This function converts the weekday-numbers from the
standard function to an offset acc. to the ISO version
monday -> 0, ... , sunday -> 6
%END REM
     
  Dim n As Integer
     
  n = Weekday( tmpdate )
   
  If n = 1 Then ' sunday to end of week
    n = n + 7
  End If
     
  CalculateIsoWeekday = n - 2
     
End Function

This version for 53 week years comes from Bill Westaway (Bill.Westaway@fmr.com):

The following "week of the year" formula was adopted from the set that shows on your web site.
It is for applications that require 53 week years because the last few days of the year still occur in a calendar year (government reporting or payroll support would be good examples). 2002 is a good example of a 53 week year.
(you can actually get a 54th week by this definition - this formula will also work then)

The formula works in views, fields, and agents and should work for every Notes/Domino release 3.0 and greater.

As was your formula -- it's "Monday" based.

I've used your padding concept for text conversion at the end. I normally leave it in numeric form and convert to text only when I need to combine with other text, as is done in the example below.

I've tried to keep this fairly efficient (I think I might be able to improve on the WeekOfYear_Gross variable formula)

REM { routine to figure out the week of the year a given date falls into --- for those applications that require a 53 week year};
REM { (i.e. those applications where the last week of the year is the first few days of the week that};
REM {    splits across a year end boundary};
REM { it's also true that the first week of the year is defined as the last days of the week that splits across a year end boundary.};
REM {   Its actually possible to get 54 week years by this definition!};

REM { Set the below Variable (SourceDate) to the value of the field that contains the date we will work on};

SourceDate := CompletedOnDist;

REM {First fugure out what the first day of the year in question is.};

FirstOfYear := @Date(@Year(SourceDate); 1; 1);
FirstDayNum_SundayBased := @Weekday(FirstOfYear);
FirstDayNum_MondayBased := @If(FirstDayNum_SundayBased = 1; 7;
FirstDayNum_SundayBased -1);

REM {Then get the week of the year for this date};
WeekOfYear_Gross := @Integer(@Integer(((@Date(SourceDate) - FirstOfYear) / (86400)) + 1) / 7) +1;

REM {Then adjust the week because the first day of they year may not fall on Monday};

DayOfWeek := @Weekday(SourceDate);
WeekOfYearNum := @If(DayOfWeek >= FirstDayNum_MondayBased;
WeekOfYear_Gross; WeekOfYear_Gross + 1);

Pad := @If(WeekOfYearNum < 10; "0"; ""); "Week " + Pad + @Text(WeekOfYearNum)

Stewart Clow (SCLOW@uk.ibm.com) modified Bill Westerly's formula to start weeks on Monday (the UK standard) instead of Sunday (the US standard):

REM { Returns the days at the start of the year up to Sunday as Week 1. Weeks start on Monday. FYI: 1984 is 54 weeks!
i.e. always returns week number for current year, rather than ISO week which can be week number for previous/next year. }

SourceDate := @Date(2009; 1; 11);

Jan1 := @Date(@Year(SourceDate); 1; 1);

DaysSinceJan1 := 1 + (SourceDate - Jan1) / 86400;
Jan1Weekday_SundayIs1 := @Weekday(Jan1);

Jan1Weekday_MondayIs1 := @If(Jan1Weekday_SundayIs1 = 1; 7; Jan1Weekday_SundayIs1 - 1);

WeekNum := @Integer((5 + DaysSinceJan1 + Jan1Weekday_MondayIs1) / 7);

PadChar := @If(WeekNum < 10; "0"; "");

"Week " + PadChar + @Text(WeekNum)

How do you get the directory the current database is in?

DBDir := @LeftBack(@Subset(@DbName;-1); "\\");
DBName := "database.nsf";
Database := @If(@Trim(DBDir) != ""; DBDir + "\\" + DBName; DBName);
Server := @Subset(@DbName;1);


How do you provide context-sensitive help for your database?

There are two ways of supporting this in Notes:

1) Use text pop-ups. You can also use @DBLookup's in pop-ups to look up code in a "help" database; this allows you to let someone edit the help in a centralized place instead of on the documents or forms.

2) Use a button that opens a help document in a help view.

@Command([FileOpenDatabase]; @DbName; "helpview";Key;"1";"");
@Command([OpenDocument]; "0");
@Command([FileOpenDatabase]; @DbName; "helpview";"";"0";"");
@Command([FileCloseWindow]);


How do you force a user to use a button to exit a form?
Use a hidden field named ButtonPressed; set this to "No" using the Default Value Formula.
In the button macro, set this flag variable:

FIELD ButtonPressed := "Yes";

Add a hidden field called Verify with the Validation Formula:
@If(@IsDocBeingSaved & (ButtonPressed != "Yes"); @Failure("Please use the Finish Button!"); @Success)

How do you make a Computed For Display Rich Text Field?

Computed when composed formulas don't just execute when the document is composed. They execute when the form is edited and the field doesn't exist in the document. So they're really computed-when-field-doesn't exist formulas, which is also true for a new document.

Create another field whose formula deletes the rich text field on saving the document. For the rich text field, use a DbLookup to initialize the field. This gives you, in effect, a computed-for-display rich text field.


How do you look up all the people in a Group?

You can use this formula to get the Common Name list of persons in YourGroupName

  @Name([CN];@DbLookup("";@Subset(@MailDbName;1) : "Names.nsf";"Groups";"YourGroupName";
"Members"))


How do you send mail based on whether a field is modified?

Use a hidden computed field to monitor the target field for changes. For example, if the field you want to monitor is named "Dept", make a hidden computed field of the same type named "Monitor" with a formula similar to:

@If((Monitor=Dept)|(!@IsDocBeingSaved); @Return(Monitor); @Success);
@MailSend(Dept; ""; ""; ""; "Dept changed to yours"; "Doclink:"; [IncludeDoclink]);
Dept


How do you execute DOS commands from a formula?
Use the macro (note the use of the /C in the DOS command):

@Command([Execute]; "C:\\COMMAND.COM"; "/C DEL C:\\TEST.TXT")

How do I calculate the number of weekdays between two date fields?
The following formula counts the number of weekdays (but not weekend days):

diffDays := (EndDate - StartDate) / 86400 + 1;
strtDay := @Modulo(@Weekday(StartDate); 7);
endDay := @Modulo(@Weekday(EndDate); 7);
result := (diffDays - endDay + strtDay - 8) * 5 / 7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay

Can I look up Multiple Keywords using @Db functions?
Yes, by separating the multiple keywords by a colon. Also, you can reference a field which contains multiple keywords, as long as that field has "Allow Multi-Values" checked ON.

How do you make a comma-delimited ASCII export file?

To make an comma delimited ASCII text file, make a view with one column. This column contains all of the fields to export. Use quotes around each field in case there are commas in the fields.

Here is a sample column formula:

"\"" + ContactSalutation + "\",\"" + @RightBack(ContactName; ", ") + "\",\"" + @LeftBack(ContactName; ",") + "\",\"" + @If(ContactTitle != ""; ContactTitle; "") + "\",\"" + @If(ContactDivision != ""; ContactDivision; "") + "\",\"" + CompanyName + "\",\"" + @If(ContactAddress1 != ""; ContactAddress1; "") + "\",\"" + @If(ContactAddress2 != ""; ContactAddress2; "") + "\",\"" + ContactCity + "\",\"" + ContactSt + "\",\"" + ContactZIP + "\",\"" + @If(CompanyCountry != "USA"; @UpperCase(CompanyCountry); " ") + "\""

The output looks like this:
"Mr.","Bill","Weber","","","ABB C-E Environmental, Inc.","261 Commercial Street","P.O. Box 7050","Portland","ME","04112"," "
"Mr.","Dan","Ryan","Director of Engineering","Cogeneration","Charles T. Main, Inc.","Prudential Center","","Boston","MA","02199"," "

You can either manipulate the Selection formula or the Print Selection to select the data you want.

Here is a a small macro which allows you to name the text file for output:

@Command([FileExport]; "Tabular"; (@Prompt([OKCANCELEDIT]; "Export File"; "Enter the export file name."; "C:\\winword\\out.txt")));
SELECT @All


Can I lookup Rich Text using @Db functions?
Yes, but if the value you are trying to look up is in a view column, it will fail.

How do I automatically categorize incoming mail?
Add the following to the Mail/Paste macro for your mailbox:

FIELD Categories :=
  @If(@Contains(From; "lnotes-l"); "LNOTES-l Internet";
  @Contains(From; "QuoteCom"); "QuoteCom";
  @Contains(SendTo; "SATL-CON"); "Satl-Con"; "");
SELECT @All

How do you notify the author of a document when a response has been composed?

1) In the Main Document, Response and Response to Response forms, create a field called 'From', defaulting to

@Name([CN];@Username);

2) In the Response Form, create a hidden field called 'ParentFrom', defaulting (with inheriting on) to:
From

3) In the Reponse to Response, create a field called 'ParentFrom' defaulting to (with inheriting on):
ParentFrom:From

4) In Response and Response to Response forms, add another hidden computed for display field called 'Announce' with this formula:
@If(@IsDocBeingSaved;@Success;@Return(0));
List := @Trim(@Replace(ParentFrom;From;""));
@If(@Elements(List) > 0; @Success;@Return(0));
SendList := @Prompt([OKCANCELLIST]; "Mail Notify?"; "Send mail notification about your reply to ";"";List);
@If(@Elements(SendList) > 0; @Success;@Return(0));
@MailSend(SendList; ""; ""; "Ref:" + OriginalSubject; ""; "My reply: "; [IncludeDoclink])

How can I control whether the @Db Function returns a list?
If the @DbLookup key is valid for multiple documents, it will return a list. All @DbColumns will return a list (unless there is only one value in the Lookup View). If you want to return only one value, use

@Subset(@DB Function; 1)
or
@Subset(@DB Function; -1)
.
If you want the @Db Function to return a list to a field, make sure that "Allow Multi-Values" is checked ON.

What tricks can you use for debugging?

In Notes V3, there is no debugger, so you can do the same things you can do if you didn't have a debugger in another language:
1) Use @Prompt() just like using print statements in programs
2) Use Debug Fields to display values
3) Use @Mailsend to send yourself mail messages detailing variable values or branching at selected points in formulas


Why doesn't my filter macro run as a background macro?
In the notes.ini file for the server where the database resides, make sure the line "MailServer = " is set to the name of the server where the database (with the macro) resides. If that line is not in the notes.ini, add it.

Can you use regular expressions for string matching?

Look for the following formula to return true in each case.

To check if a character is alphanumeric...

@Matches(Char; "{A-z}")

To check for "a" or "b" or "c" ...

@Matches(Char; "{a-c}")

To check for all upper case alphanumeric plus the letters "a" or "b" or "c" and "d" ...

@Matches(Char; "{A-Za-d}")


To check for $321,000 or $321.000 but not $321.00 or $321,000- ...

@Matches(Dollar; "{$}{0-9}{0-9}{0-9}{,.}{0-9}{0-9}{0-9}")

To check for US long distance phone number...

@If(
  @Matches(PhoneNum; "{0-9}{0-9}{0-9}-{0-9}{0-9}{0-9}-{0-9}{0-9}{0-9}{0-9}");
  @Success;
  @Failure("The Phone number must be in the format \"xxx-xxx-xxxx\"")
)

To check for social security ...
@Matches(SSNum;"{0-9}{0-9}{0-9}-{0-9}{0-9}-{0-9}{0-9}{0-9}{0-9}")


Why can compose-restricted forms be composed when the database isn't open?
This is a Notes bug. The only workaround for this is to make the form hidden so it doesn't show up in the Compose Menu.

How do you create a Doclink automatically?
Add these lines to your macro:

@Command([FileOpenDatabase];"database";"view";"key";"1";"1");
@Command([EditMakeDocLink]);
@Command([FileCloseWindow]);
@Command([EditDown];"1"); ==> how many fields down from your button
@Command([EditPaste]);

Can you implement exclusive locking across replicated databases?

This is impossible using Notes. Think about what would be required. You have a database replicated to multiple servers and clients. If a user opens a document, how would all the other unconnected databases know about this?
The only way to do this using Notes is to have a single un-replicated database. Normally, a redesign of the application is enough to work around this requirement.
Note that similiar problems occur if you try this with relational databases.


How do you add an Internet-style signature at the bottom of your mail messages?

Create a SmartIcon with this formula

  @Command([EditBottom]);
  @Command([FileImport];"ASCII Text"; "C:\\Notes\\data\\sig.txt")

and place your Internet-style signature in the sig.txt file.

You can then use this SmartIcon whenever you are in the body field of your Notes mail. It will append your signature to the message.
Here is another way to do this (from jessica@newmill.com) so that it happens on all memos you send out (but it requires your users to change each of your mail templates and also affects Notes mail messages because it affects all memos):

Open the New Memo form in design mode.
Click on the Body field to select it, then write the following in the "default value" section:
@NewLine+@NewLine+"Jessica Spinosa"+@NewLine+"New Millennium Inc."+@NewLine+"jessica@newmill.com"


Can I look up a DocLink using @Db functions?
Yes, but you will have to perform two Lookups. One Lookup will return the contents of the Rich Text Field containing the DocLink itself, and the other will return the contents of the field called, "$LINKS." This second Lookup must return its value to a field also called, "$LINKS." The information in the $LINKS field is the pointer information which tells the DocLink where to go. When you perform the two Lookups, the first field will become data type 'Rich Text' and the $LINKS field will become data type 'Doclink Reference List.' After saving and closing the document, the DocLink will be activated. Failing to follow these steps will result in the error message: "The DocLink Database Cannot be Located."

How do you remove orphan response documents?

You need a hidden view named (UNID) which has one column with a formula of:

  @Text(@DocumentUniqueID)

Run this as a nightly agent:

  SELECT @IsAvailable($Ref) &
    @IsError(@DbLookup("" : "NOCACHE"; "";"(UNID)"; @Text($REF); 1));
  @DeleteDocument

It will find and delete all orphans using this hidden view.


In what order do @Commands execute?

1) Declare variables
2) Declare fields
3) @Functions
4) @Commands


How do you convert a time field to display as military time?

REM "From Jason Collier (jcollier@sd.synetics.com)";
time := @Time(StartTime);
t:= @Text(@Time(time));
t2:=@Left(@Text(@ReplaceSubstring(@Text(@Time(time)); ":" ;"")); 6);
h:=@Left(t2;2);
s:=@Right(t2;2);
m:=@Middle(t2;2;2);
AM:=@ReplaceSubstring(@Left(t2;2) ; "12" ;"00");
PM:=@ReplaceSubstring(@Left(t2;2) ; "12" ;"12");
PM2:=@Text(@TextToNumber(h)+12);
timecheck:= @If(@Contains(t;"AM"); AM ; @If(@Contains(t;"PM") & @Contains(@Left(t2;2);"12") ; PM ; PM2));
timecheck + m

Can you stop the refresh view indicator for displaying if you use @Today in a view?

This is an undocumented workaround. If you use this formula code:

  Today := @TextToTime("Today");

The view will still get updated daily, but the refresh view indicator will not be displayed.


How do you prevent jagged right table edges when merging/splitting cells?
From Pam Clinton:

When you create a new table, add a column that is as small as possible (0.125") and hide all cell edges and make it transparent. Never use this column. Don't merge it in, etc. Notes just screwed up the last column when displaying these jagged tables.

Unfortunately, there's no fix for corrupted tables except recreating them.


Companies with Notes Applications

* GroupQuest Software
* Application Partners
* Groupware Technologies
* Cambridge Software Group
* Ives Development (makers of the TeamStudio Design System, application development tools for Lotus Notes and Domino; they also make Caio!, a revision control system for Notes; they also make Delta, Configurator, Design Manager, Profiler, Snapper, and Validator)
* Candle/Cleversoft
* Mayflower Software
* Casahl Technology
* Brainstorm Technologies
* QDM
* Binary Tree (makers of BT Migration Suite and eTeam)
* Solutions By Design (makers of NavMaker, a Notes Navigator editor)
* Business Evolution (makers of InteractPro, a Java chat environment for Domino)
* AppJunction
* Technovations International (makers of Notes capacity planning tools)
* Extracomm Technologies (makers of ExtraFax)
* G2 Associates (makes of ProActive Assistant, a Notes stress-testing tool)
* Genii Software (makers of the Midas Rich Text LSX)
* Metaware bv
* Surety Technologies (makers of Digital Notary Accelerator for Lotus Domino)
* GSX Groupware Solutions (makers of the GSX Administration Suite)
* GlobalServe (makers of PageMe! pager gateway and Sales Accelerator: Contact
Management System)
* xorTech Systems (makers of InfoSync, a client replication admin tool)
* ErgoTech (makers of Act! For Notes)
* Greyfriars Consulting Group, Inc. (makers of Domino business components)
* DPI Services (makers of QMX, quality management software)
* DataMirror (makes of a Notes/ODBC replication tool)
* GFI (makers of FAX gateway, Workflow and Internet gateway software)
* CommVault (makers of CommVault for Notes, a doc-level backup program)
*
ProjectEdge (makers of a construction project management application)
* Jagre (makers of version control and change management software)
* DominoAnalyzer (makers of web security analysis software)
* Cassetica (makers of GroupManager, CCI, NotesMedic)
* Sorites (makers of mailing list and survey software)
* SoftVision makers of NotesToPaper (a reporting tool) and n2pdf (a tool to convert Notes content - including links - to the pdf format)
* Colligo (makers of Lotus Notes Workgroup Edition, that lets Notes clients replicate with each other directly)


Local User Groups

* WALNUT
* WALNUT Canberra, Australia
* Wisconsin Notes User Group
* Charlotte Lotus Notes User Group (in North Carolina)
* St. Louis Domino Notes User Group (in Missouri, USA)
* Washington, DC Notes User Group
* GRANITE (Notes User Group in Chicago)
* NUTS (Notes User Group for Ohio, Kentucky, Indiana)
* Atlanta Lotus Notes Users Group
* New England Domino and Notes Special Interest Group
* IBM's Notes User Group List


Notes Related Web Sites

Lotus' Notes Knowledgebase can be queried here. This is a great place to search for known bugs and workarounds that Lotus recommends.

These are all Domino Discussions:
* Lotus Domino Discussion
* Lotus Japan Notes Dicussion

Other Sites from Lotus and Iris Associates:
* Lotus Domino Wiki
* Lotus Development Corp. Home Page
* Lotus' Developer Central
* Notes.ini Settings

Other good Notes web sites:
* XPages Info site
* Frank Cseh's Notes Page
* European Notes Page
* Rose Kelleher's (a great book author) Notes Stuff
* Notes Design & Development
* Lotus Notes Job Listings
* E-Pro Mag
* Notesnet.Com
* Domino Security news
* Domilock (Domino web security checking tool)
*
Breaking Par (Domino web hosting and free code snippets)
* Emie's Notes Links
* DRCC Notes.ini Reference
* SearchDomino
* Notes WikiFAQ
* Domiclipse (lets you write/debug Java agents using Eclipse)
* Open Source Quickplace Templates from SNAPPS
* Domingo (Java Notes API w/o needing recycle calls)
* Ext.ND (Web 2.0 extensions for Domino)
* Lotus Notes is Cool
* XPage Sample Apps and Controls


Mirrors Sites for the Notes FAQ

The following sites mirror this FAQ site:
* KEY Enterprise Solutions


Non-Notes Web Sites

* Notes Icon Catalog
* Icon Bazaar


What Notes Related RSS Feeds Are There?

* Lotus has a Support RSS feed that updates you on any technote changes.
* Ed Brill has a Blog that has an RSS feed.
* InsideLotus weblog