Submit a Code Fragment... Submit a Code Fragment...

Previous Next Expand Collapse Search
NameLink to viewDescriptionTypeLink to viewSourceLink to viewDateLink to view
68
Show details for Date/Time HandlingDate/Time Handling
17
Show details for Design ConfigurationDesign Configuration
8
Show details for Diagnostics/Analysis/DebuggingDiagnostics/Analysis/Debugging
3
Show details for Documentation (System)Documentation (System)
3
Show details for Documentation (User)Documentation (User)
1
Show details for EmailEmail
6
Show details for Email/PIMEmail/PIM
1
Show details for Error HandlingError Handling
12
Show details for File Input/OutputFile Input/Output
21
Show details for List Processing/SortingList Processing/Sorting
9
Show details for Numeric ProcessingNumeric Processing
4
Show details for OLE/ActiveX IntegrationOLE/ActiveX Integration
2
Show details for Printing/FaxingPrinting/Faxing
5
Show details for RDBMS IntegrationRDBMS Integration
3
Show details for ReplicationReplication
7
Show details for Reporting/SearchingReporting/Searching
13
Show details for SecuritySecurity
5
Show details for String HandlingString Handling
21
Show details for User Interface (Notes)User Interface (Notes)
32
Show details for User Interface (Web)User Interface (Web)
15
Show details for Website ToolsWebsite Tools
9
Show details for WorkflowWorkflow
599
Hide details for (Misc)(Misc)
This formula reformats the contents of Person_Name to put the last name first followed by a comma, a space, and the first name. This formula reformats the contents of Person_Name to put the last name first followed by a comma, a space, and the first name.FormulaRlatulippe@romac.com04/19/2000
Adding a Variable into String for LotusScript Search MethodAdding a Variable into String for LotusScript Search MethodLotusScriptRlatulippe@romac.com04/19/2000
Set a dialog box to "always on-top"Editor's Note (11/30/95): This example uses 16 bit Windows API calls and will not work in the 32 bit. For the same functionality in the 32 bit version of Word Pro, change the Declare statements to the appropriate 32 bit Window API call. Place the following declarations in the Globals, and the Dialogevent code in your dialog box object, and the dialog box will be set to be always on top, even when you switch to another application. Note: this will probably not work with dialog bars, since they are child windows of Word Pro, not top level windows like normal dialogs. Note2: This will be slighly easier (and more robust) when the GetHwnd method is implemented for CustomDialog.LotusScriptRlatulippe@romac.com04/19/2000
Convert Date to Day of the WeekUse this formula in the input translation of a Date/Time field to translate to day of the week:FormulaRlatulippe@romac.com04/19/2000
Format E-mail AddressesMost Web sites that collect user contact information require users to enter their e-mail addresses. The formatEmail function checks to make sure an e-maill address has been enetered in the correct format - if not, it returns an empty string.JavaScriptRlatulippe@romac.com07/08/2000
Use FrontEnd Classes to pass Current Document to Backend classes!LotusScriptRlatulippe@romac.com04/19/2000
Factorial of n using recursionReturns the factorial of a number n using recursionLotusScriptRlatulippe@romac.com04/19/2000
Assigns current field the full name of a state, given a field 'State' with
the standard state Abbr.
Assigns current field the full name of a state, given a field 'State' with
the standard state Abbr.
FormulaRlatulippe@romac.com04/19/2000
IsLogErrors propertyThis agent disables and enables error logging.JavaRlatulippe@romac.com04/19/2000
Button to ask for object to insertFormulaRlatulippe@romac.com04/19/2000
NotesDocumentCollection classThe example below uses GetFirstDocument and GetNextDocument to display the title of documents in the Intermediate view that contain the word "NotesDocumentCollection".LotusScriptRlatulippe@romac.com04/19/2000
Move Orphans to FolderFinds orphan documents and moves them to a folderLotusScriptRlatulippe@romac.com04/19/2000
Subtracts one array from another!This script takes two arrays and subtracts the smaller array from the larger array.LotusScriptRlatulippe@romac.com04/19/2000
QueryDocumentDelete script to prevent deletion of a document marked as PermanentAfter I accidentally deleted an important document in one of our databases, I wrote this
little script to prevent it from happening again. This script will disable deletion of
any document (even by managers)marked as "Permanent" in a keyword, checkbox field on the
document form. This agent runs in the QueryDocummentDelete event of the database.
LotusScriptRlatulippe@romac.com04/19/2000
Check for down serversChecks for Down ServersLotusScriptRlatulippe@romac.com04/19/2000
Calculate current relative directory on ServerThis formula calculates the current relative directory on the current server. You can append a filename of a database expected to be found in the same directory in order to access it. This formula allows you to install a suite of databases which will always access each other within the SAME DIRECTORY. Either server-relative paths or full local drive-directory paths will work Note: You also need a formula to compute the server name. This is simply: @Subset( @DbName; 1 ). To get fancier, check the platform using @Platform and use the ! separator for the Macintosh.FormulaRlatulippe@romac.com04/19/2000
lotus.notes.Agent class2. This example prints the names of all agents in the current databaset.JavaRlatulippe@romac.com04/19/2000
Preventing UI refresh when working with FramesetsOn the Web instead of having your forms reload constantly, create a Frameset where one frame has a size of zero. Open a form in each frame. Using JavaScript to react to button presses or other actions, move the data you want to submit to the hidden frame and force the submit of that document. Now your UI doesn't refresh and the user still executes the submit action.JavaScriptRlatulippe@romac.com07/08/2000
API Call to WIN32 to Utilize Windows Get File dialogbox. (Win95 Version)Brings up the Win95 get file dialog and allows you to select a file.LotusScriptRlatulippe@romac.com04/19/2000
Build a Table in Excel from Lotus Notes.Simple code that builds a pivot table in an existing Excel spreadsheetLotusScriptRlatulippe@romac.com04/19/2000
Five Reusable LotusScript Functions for Working with Lists When working with lists, the same functions seem to come up time and time again. We thought that it would be useful to group some of these LotusScript functions together so that you could find them in a single resource. Here are the basics that are covered: 1. Remove from List
2. Add to List
3. Remove Item from List
4. Entry in List
5. Remove Range from List
LotusScriptRlatulippe@romac.com04/19/2000
Auto Refreshing a UI document from a back end document.The original goal was to open a UI doc, and keep it open while periodically refreshing the fields from the back end doc.LotusScriptRlatulippe@romac.com04/19/2000
PostOpen Code to check we have correct Parent documentChecks the selected document from which we are creating reponse to ensure we have the correct parent form. If not Display error message and close response document.LotusScriptRlatulippe@romac.com04/19/2000
Notifying Users of New Production DB'sUse the following database to add new DB's to users desktop.FormulaRlatulippe@romac.com04/19/2000
How do you find the positions of a string in a text list?Button code used to find the position of all of your characters:FormulaRlatulippe@romac.com04/19/2000
Deletes an Item from a List Deletes and item from a listFormulaRlatulippe@romac.com04/19/2000
Evaluate method1. This agent applies the @ProperCase @function to the Subject field in every document of the current database.JavaRlatulippe@romac.com04/19/2000
Agent for Encrypting DocumentsAgent for Encrypting DocumentsLotusScriptRlatulippe@romac.com04/19/2000
getEnvironmentValue method2. This script gets the value of the system environment variable Timezone.JavaRlatulippe@romac.com04/19/2000
Search and ReplaceSearches for a term in a target string and replaces it with another string.JavaScriptJamie Magee01/31/1999
FormatDocument methodThis agent makes a document collection of all the documents (up to 15) in the current database containing the word "arachnid," and makes a newsletter based on the document collection. The agent formats a newsletter document for each document in the collection and sends them to the current user.JavaRlatulippe@romac.com04/19/2000
Sampling of SQL Statements that Can Be Used with NotesSQL commands that can be used with Notes?LotusScriptRlatulippe@romac.com04/19/2000
Code for calculating business days in LotusScript.Calculates the business daysLotusScriptRlatulippe@romac.com04/19/2000
This formula puts the name of the current weekday in the column, except that Saturdays and Sundays are treated as Fridays. This formula puts the name of the current weekday in the column, except that Saturdays and Sundays are treated as Fridays.FormulaRlatulippe@romac.com04/19/2000
OpenAgentLog methodThis agent opens the agent log and writes an action message to it.JavaRlatulippe@romac.com04/19/2000
API Call to access the Clipboard in Notes?This function (thanks to Manfred_Doerwald@IDG.DE) calls Win32 functions to put a field in the clipboard:LotusScriptRlatulippe@romac.com04/19/2000
Mail a Lotus Notes document link through MS Outlook.Mails Link Through Outlook. This action button will create a link on the fly that will be saved to the users C:Drive as link.ndl then it will call the Subroutine AutomateOutlook. This routine will display the outlook mail modal with the link embedded in the body of the mail template. The user then fills in the To: field on the modal and sends the link. The Recipients of the mail must have Lotus Notes on their machine. When they click on the link in their Outlook mail. It will then launch Notes and the link.LotusScriptRlatulippe@romac.com04/19/2000
Comment propertyThis example prints the name and comment of the current agent.JavaRlatulippe@romac.com04/19/2000
Change all scheduled Agents to Run on different Server nameR5 - Administrator Assist
Moved/replicated countless databases from old servers to new. Servers were named differently. Had to fix all scheduled agent to set correctly to run on new server.
LotusScriptSuzy@viperss.com01/21/2002
voxqtishhHH69YV <a href="http://gqfsgqfqlsnx.com/">gqfsgqfqlsnx</a>, [url=http://jhwrhornaown.com/]jhwrhornaown[/url], [link=http://fvnqhajnjakl.com/]fvnqhajnjakl[/link], http://lzrueecqicro.com/LotusScript,HTML,JavaScript,Java,ActiveX/OCX/OLEAnonymous11/02/2014
Compiling and running a Java program4. This is an agent program with print output that can be seen by a browser:JavaRlatulippe@romac.com04/19/2000
Creating a database from a templateCreating a database from a templateLotusScriptRlatulippe@romac.com04/19/2000
Working with dates from an external data sourceYou are working on a Y2000 project. Your application reads data from an external source. You want all the dates read in to be convert to mm/dd/yyyy format. If you are thing about using the following codeFormulaRlatulippe@romac.com04/19/2000
Force the value of a field to be unique.How to force the value of a field to be unique?FormulaRlatulippe@romac.com04/19/2000
Using the LotusScript Data Object (LS:DO) Error MethodsThe following information explains how to use the LotusScript Data Object (LS:DO) error
methods.
LotusScriptRlatulippe@romac.com04/19/2000
InitialsConverts a name to initialsFormulaRlatulippe@romac.com04/19/2000
Conditional Branching: The ForAll StatementThe ForAll statement was made especially for arrays. It has the ability to operate on all the elements in an array without you knowing how many elements are in the array.LotusScriptRlatulippe@romac.com04/19/2000
Create Discard Button to Exit DocumentWhen used in a button or action button, this formula provides the users a quick way to exit and not save a document.FormulaRlatulippe@romac.com04/19/2000
updateProcessedDoc methodThis example is for an agent that runs on newly created and modified documents since the last run. The program gets the unprocessed documents, prints each Subject item, and marks each document as processed. The first time the agent runs, getUnprocessedDocuments returns all of the documents in the database. Thereafter, getUnprocessedDocuments returns those documents that updateProcessedDoc has not touched.JavaRlatulippe@romac.com04/19/2000
Window Formula - Responces, New, SubjectWindows FormulaFormulaRlatulippe@romac.com04/19/2000
How do you operate on the currently selected documents in LotusScript?The ... part in the code below marks where you can put code to access the active document.LotusScriptRlatulippe@romac.com04/19/2000
Accessing Notes Session PropertiesUsing the object.property syntax, you can access all the session properties. Let’s look at an example:LotusScriptRlatulippe@romac.com04/19/2000
How to open a new window and navigate to a Web page using a Keyword List and JavaScriptHow to open a new window and navigate to a Web page using a Keyword List and JavaScriptJavaScriptRlatulippe@romac.com07/08/2000
Telephone Formatting : (input Translation)Telephone Formatting : (input Translation)FormulaRlatulippe@romac.com04/19/2000
Using @Prompt and @DbLookup to simulate @Picklist but only on a subset of documentsWe have a view in a seperate database whose first column is $Ref. We want to pull a only those documents matching the parent I.D. that we pass but want to display to the user something readable. So we use Concatenated DbLookups in an @Prompt to let the user see the name they wish to select. We then parse out the selected documents I.D. so we can pull in its data in PostOpen code.FormulaRlatulippe@romac.com04/19/2000
Limit deletes in QueryDocumentDelete to response documents onlyChecks to ensure that only response documents are being deleted.LotusScriptRlatulippe@romac.com04/19/2000
List OptimizationLists are one of the most powerful features in Domino. Here's an optimization technique. Instead of this formula:FormulaRlatulippe@romac.com04/19/2000
Deleting Duplicate Documents from a DatabaseProblem: There are many instances when one needs to know whether there are duplicate documents in a database. Having a macro which could identify or even delete these duplicate docs would be great! Solution: By duplicate documents, we really mean documents with the same ID, where ID can be any unique identifier you choose; CallNumber, CustomerName, SocialSecurityNumber, etc... (this should not be confused with Replication Conflicts, which are multiple instances of the same document!) Given this definition, there are two principal cases we will consider: 1. Duplicate documents within a database 2. New versions of some documents are to be imported, and the user doesn't want to create a condition where there are duplicate docs. Therefore, they want to delete the old docs before importing their new counterparts.FormulaRlatulippe@romac.com04/19/2000
Using the 'With' statement in JavaScriptThe 'with' statement in JavaScript lets you preface an object and all of its properties and methods without a long object address, saving you time while you are coding. For example this function below uses the 'with' statement after the function is declared. The with statement passes the form object which allows the rest of the script to access the form's properties and methods without a full address.JavaScriptRlatulippe@romac.com07/08/2000
Add together two one-dimensional arrays!Takes two arrays and builds them into one.LotusScriptRlatulippe@romac.com04/19/2000
1. Select ButtonThis formula is the first of a series -- for a set of four buttons: SELECT, ADD, EDIT, and CLEAR. These are simple formulas but they allow you to have a multi-value field showing a list of names (or of any text items) which you can initialize by selecting, add to, edit, or clear. The first button, SELECT, does a select and loads a field called ReaderList. For simplicity, we are using an R4 N&A picklist, but you could also use @DbLookup, or an @PickList view lookup.FormulaRlatulippe@romac.com04/19/2000
Performing a SearchPerforming a SearchLotusScriptRlatulippe@romac.com04/19/2000
Editor Access to a SectionUse this formula in the section field of a form to indicate who may edit that section (used to disallow the initial author access after composition): When using a form that is divided into two sections, and both sections have computed values, follow this procedure to allow only certain group members editor access after the initial document creation.FormulaRlatulippe@romac.com04/19/2000
ProgramName propertyThis agent prints the program name.JavaRlatulippe@romac.com04/19/2000
Notes R4, you are attempting to add a user's name to an Access Control List (ACL) via LotusScript. When you add the user's hierarchical name to the ACL via the NotesACL New method, however, the user is still unable to access the database.Add names to the ACL via LotusScriptLotusScriptRlatulippe@romac.com04/19/2000
NotesACL ClassThis example will ask you for the name of a role. Once the role name has been entered, all of the names in the role will be displayed.LotusScriptRlatulippe@romac.com04/19/2000
How to Display a Document, that Isn't the Current Document, w/ LotusScriptIllustrates one way to get a handle to a particular document (via a backend method) and then make the document the new UI document that displays on the screen. Specifically, the application performs the following actions:LotusScriptRlatulippe@romac.com04/19/2000
Preventing Line Wrap Within a Table CellIf you do not want your line to wrap within a table cell, follow this tip: Truncate the contents in a display field, and allow users to press the table cell popup to view the full text, which is stored in a hidden field.FormulaRlatulippe@romac.com04/19/2000
DocumentContext propertyThis example prints the value of the Text field of the in-memory document.JavaRlatulippe@romac.com04/19/2000
AlphaQuickSort function which sorts the elements in the array. This example asks the user for input of names and assigns each name to an element in the array. On NULL input it calls the AlphaQuickSort function which sorts the elements in the array.LotusScriptRlatulippe@romac.com04/19/2000
Open word and run one of the Macros.Opens Resume.doc on c:\ and runs a macro called macro1.LotusScriptRlatulippe@romac.com04/19/2000
Selection FormulaSelects people for hidden lookup view, based on values in their job title. This is used in the employee directory.FormulaRlatulippe@romac.com04/19/2000
DBLookup for a Range of ValuesTo use a DBLookup to return a text field (i.e. Approver for a specified dollar amount) which relates to a range of values, follow this tip: Your criteria: Low Amount High Amount Approver
$0 $499 Bill Smith
$500 $2,499 Fred Jones
$2,500 $4,999 Mike Williams
$5,000 Joe Smith
Set up the view this way: Column1: Formula: @Text(LowAmount)+"@"+ApproverName 0@Bill Smith
500@Fred Jones
2,500@Mike Williams
5,000@Joe Smith
FormulaRlatulippe@romac.com04/19/2000
Export a Lotus Notes document to excel (creating the excel spreadsheet) We use the following code to export a lotus notes document to excel
(creating the excel spreadsheet).
LotusScriptRlatulippe@romac.com04/19/2000
Directing New Users to a Special ViewIn R4.5 you can write a script that executes whenever a user opens the database. For example, you might want to direct new users to a special view, while letting old users proceed straight to the default view. To do this, write a script for the database object's Postopen event, as follows:LotusScriptRlatulippe@romac.com04/19/2000
How to Search for a Date Value When Using the GetDocumentByKey MethodUsing the Format function, you can store the date in a mm/dd/yy format, which zero-fills the date and allows for
proper searching.
LotusScriptRlatulippe@romac.com04/19/2000
Display Help Dialog BoxDisplays a Help Form, use with button and hotspotsLotusScriptRlatulippe@romac.com04/19/2000
Query propertyThis script prints the name and query of every agent in the current database.JavaRlatulippe@romac.com04/19/2000
Determining the End of a File with LotusScriptLotusScriptRlatulippe@romac.com04/19/2000
Fix Call ID#Used in the support Desk application in the Call form for the CallIDNumber Field.FormulaRlatulippe@romac.com04/19/2000
Update a field in all the response documents from a field that has changed in the parent document.The following LotusScript which will take a value in the parent document and push it
down into all the response documents. Place the script in the Querysave event of your parent form.
LotusScriptRlatulippe@romac.com04/19/2000
Creating a New and ModifiedCreating a New and ModifiedLotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Newsletter class2. This agent performs a full text search on the current database and creates a newsletter. The agent formats a newsletter document for each matching document and saves it in the database Reports.nsf.JavaRlatulippe@romac.com04/19/2000
Using @UserName in a view.Use @Username in a viewFormulaRlatulippe@romac.com04/19/2000
Inport From ODBC (Tech Incident Database Example)LotusScriptRlatulippe@romac.com04/19/2000
Directing New Users to a Special ViewThis script executes whenever a user opens the database and directs new
users to a special view, while letting old users proceed straight to the default view.
LotusScriptRlatulippe@romac.com04/19/2000
Using LotusScript for Unattended File Import in a Notes ViewLotusScriptRlatulippe@romac.com04/19/2000
This script imports information from documents in another database.This script imports information from documents in another database.LotusScriptRlatulippe@romac.com04/19/2000
getURLDatabase methodThis program opens the default Web navigator database.JavaRlatulippe@romac.com04/19/2000
TimeDifference methodThis agent calculates the number of days since a document was created.JavaRlatulippe@romac.com04/19/2000
FormatMsgWithDoclinks method; IsDoScore, IsDoSubject, and SubjectItemName propertiesThis agent makes a document collection of all documents in the current database containing the word "archanid," then makes a newsletter based on this document collection. The agent formats a messge with links to the newsletter documents and mails it to the current user.JavaRlatulippe@romac.com04/19/2000
MS Excel Import, using OLEHere's an excel import, using OLE, that can be fairly easily modified to import anything that has OLE classes registered (it can be easily adapted to read every MS Project file in a directory, and pull out each task separately as a Notes document).LotusScriptRlatulippe@romac.com04/19/2000
Quicksort one less recursive callDoes a quicksort on an array!LotusScriptRlatulippe@romac.com04/19/2000
Send Notification With DocLink Back To DocumentThis formula sends a notification to another user with a doclink that takes the user back to the original document. This is an ideal way to centralize data in a database while notifying users by mail that there is work waiting for them in another database.FormulaRlatulippe@romac.com04/19/2000
How to Create a Document with "Store Form in Document" via LotusScript Back-End LotusScriptRlatulippe@romac.com04/19/2000
Generate Response Docs in LotusSciptThis view action will call a LotusScript agent to generate response documents on an entire database (all it's parent docs, that is). This formula can be found in the World Wide Country Database as a view action called "Add Fund To Countries". This view action first does a lookup on the Fund Library database. The user selects a new fund fromn this library and VIOLA! All the country documents will have a new fund doc (this is the response doc). This action calls the agent to do the actual creation of the response docs. The agent is hidden and is set to run on all docs in the view. The agent name is called Add Fund and it's event is set to INITIALIZE.LotusScriptRlatulippe@romac.com04/19/2000
Creating a Search Agent - Challenge*Creating a Search Agent - Challenge*LotusScriptRlatulippe@romac.com04/19/2000
API call to NNOTESWS.DLL to display Windows BrowserUses a call to a function in the notes DLL to display the windows browserLotusScriptRlatulippe@romac.com04/19/2000
How to Compare Dates Using LotusScript It seems as though comparing dates would be a straight-forward task; however, it is actually rather complicated. A quick, easy approach is to use simple comparison operators, but via this approach - the question remains of how you get the
dates from Notes into the back-end and then manipulate it once it is in the script. The following instructions and sample code,
however, demonstrate how you can do this:
LotusScriptRlatulippe@romac.com04/19/2000
IsLogActions propertyThis agent disables and enables the action logging.JavaRlatulippe@romac.com04/19/2000
Dynamic Lookups with DefaultsThis formula will enable the user to create a (dynamic) keyword lookup based on what has been entered. The formula looks into the current database, in this case, the view "by Category" and also includes default values that will remain even if those documents were deleted.FormulaRlatulippe@romac.com04/19/2000
Update a field in response documents after it is changed in
the parent document?
How do you update a field in response documents after it is changed in
the parent document?
LotusScriptRlatulippe@romac.com04/19/2000
16 bit free resources and available memoryReturns Free Resources on 16 Bit SystemLotusScriptRlatulippe@romac.com04/19/2000
Forcing a Date Field to BackdateIf you need a date field to always backdate itself to the previous Sunday, try this formula: Since 1 represents Sunday, (1-@Weekday(@Today)) returns a negative value indicating the number of days between Sunday and today. So if today is Thursday, we get 1 - 5 = -4. @Adjust uses this negative value to return a new time-date value, decremented to the previous Sunday.FormulaRlatulippe@romac.com04/19/2000
API Calls to NNOTESWS.DLL to Display Progress Bar Along the bottom.Displays Notes Progress Bar.LotusScriptRlatulippe@romac.com04/19/2000
How change a frames content with an @URLOpen.How change a frames content with an @URLOpen.FormulaRlatulippe@romac.com04/19/2000
Low-level, self-contained, LotusScript
functions,
This file contains somewhat low-level, self-contained, LotusScript
functions, as well as some global constants used by these Functions. To use
these Functions, add the following line to the Declarations section of your
script module:
LotusScriptRlatulippe@romac.com04/19/2000
Sorting a Text ListThis formula will sort a text list (without numbers or punctuation). You can adjust the accuracy from 1 to 10 characters. This formula is designed to work in a field. Replace Values with your text list, and change the Accuracy variable to meet your needs. Long lists work faster with lower accuracy numbers.FormulaRlatulippe@romac.com04/19/2000
Forcing the Use of a ButtonWhen forcing a button to be pressed, use the following formula. Place the code in the field validation formula. See also the Templeton Call Report in the Sales Tracker Database...FormulaRlatulippe@romac.com04/19/2000
API calls and declarations to access the Win RegistryThis will return the path of the Notes Data directoryLotusScriptRlatulippe@romac.com04/19/2000
GetTarget Function: Gets target db as current db.Given the current database and a new filename will return that filename as the new current database if it is on the same server and path.LotusScriptRlatulippe@romac.com04/19/2000
Equivalent Rightback and Leftback functions in LotusScriptEquivalent Rightback and Leftback functions in LotusScriptLotusScriptRlatulippe@romac.com04/19/2000
Non-Notes Doc LinksFormula,LotusScriptjawsct@home.com05/17/1999
LastExitStatus propertyThis example prints the last exit status of the current agent.JavaRlatulippe@romac.com04/19/2000
Find the week number for any given date!Use this formula to find the week number for a date (it follows the same pattern as the Calendar View, with Sunday at the week end day).FormulaRlatulippe@romac.com04/19/2000
Validating a date field while allowing no date to be entered.This was used to validate a date field, several date fields were used in sequence and it was not required that they be filled at time of document compose. However this allowed the date field to be saved and prevented the default error message!FormulaRlatulippe@romac.com04/19/2000
How to Open a Navigator in Notes R4 via LotusScriptHow to Open a Navigator in Notes R4 via LotusScript
Product Release:
LotusScriptRlatulippe@romac.com04/19/2000
Compiling and running a Java program3. This is an agent program:JavaRlatulippe@romac.com04/19/2000
Inport from a Word Document!This script imports information from a Word document into a Notes document while standardizing the doc's formatting.LotusScriptRlatulippe@romac.com04/19/2000
Notify the author of a document when a response has been composed.Notify the author of a document when a response has been composed.FormulaRlatulippe@romac.com04/19/2000
How do you validate and jump to fields which have validation errors?This example will check that all required fields are filled in. If a field is not filled in, it will move the cursor in the web browser to that field.JavaScriptRlatulippe@romac.com07/08/2000
Appending a value to a fieldAppends value to a field and in this particular case, appends value to the left of what is already there. ie Change value in FundNumner field (FLNum) from F888 to 4888.FormulaRlatulippe@romac.com04/19/2000
FTSearchThis example will find any documents in the Beginning view that contain the string Method* using the view method FTSearch .LotusScriptRlatulippe@romac.com04/19/2000
getEnvironmentValue method1. This script gets the value of the environment variable $EnvNum.JavaRlatulippe@romac.com04/19/2000
Author's InitialsThis returns the authors initials (upper case) in a field.FormulaRlatulippe@romac.com04/19/2000
Searching the WebSearching the WebLotusScriptRlatulippe@romac.com04/19/2000
Exchanging items values between
documents.
EKIPUSH.LSS Function Library Notes R4 LotusScript functions for exchanging items values between
documents.
LotusScriptRlatulippe@romac.com04/19/2000
Open a Freelance Presentation via AutomationThis routine puts up a common dialog that prompts the user to select a Freelance presentation to open. If the user selects a file then it creates a Freelance automation session and opens the requested doc. It chops up the name returned from the dialog into file name and path parts for the open command. There may be a more standard way to do this but I couldn't find it.LotusScriptRlatulippe@romac.com04/19/2000
Toggling Values using a ButtonThe following formula allows you to "toggle" between values using a button. For example, a field that displays either a yes or no value is a good use of this technique. See the formula below using a Yes/No example:FormulaRlatulippe@romac.com04/19/2000
Pushing changes down the hierarchyThe following LotusScript which will take a value in the parent document and push it
down into all the response documents. Place the script in the Querysave event of your parent form.
LotusScriptRlatulippe@romac.com04/19/2000
Calculate total months between a StartDate and Today (- current month)Possible use: To get total months an employee worked for a company to calculate vacation.FormulaRlatulippe@romac.com04/19/2000
Removing an Item from All Documents in the DatabaseRemoving an Item from All Documents in the DatabaseLotusScriptRlatulippe@romac.com04/19/2000
Removing Stored Form FieldsYou can removed the Stored Form fields in a document if you decided that you no longer want to store a form with a set of documents because of the additional memory and disk space required. To remove the fields, you can create an agent that looks for a particular value in a document and then deletes the specified fields in that document as shown below. You then assocate a new value in the new Form Field to indicate what form you want to use to display the data.FormulaRlatulippe@romac.com04/19/2000
One to many/many to one @ReplaceThe @Replace will do a replace of an exact match (one-by-one) of the elements of a text string. But what if you need to replace one element with several elements, or several elements with just one? The following formula is based on the following fields: TargetField: the field containing the text to be replcaced
Keyword: the "tolist"
KeywordOld: the "fromlist". The formula should be defined in a button, not a field computation in order to work.
FormulaRlatulippe@romac.com04/19/2000
Something to watch out for with Str$This is documented, but I totally missed it, and I figure others might as well. In Ami Pro, we didn't really have to worry about data types; it was all handled internally for us. But with LotusScript, we sometimes need to do some conversions. An example is changing a number over to it's string representation. For this, you usually use Str$. But watch out! Str$ returns a leading space. So, Str$(1) actually returns " 1". Usually this won't matter, but in some cases it can come back to bite you. Here's some example code where Str$ doesn't work as expected because of the leading space...LotusScriptRlatulippe@romac.com04/19/2000
LogError methodThis agent searches for "Rocks" in the documents in the current database and logs an error message to logerror.log in the current Notes directory if no occurrences are found.JavaRlatulippe@romac.com04/19/2000
Calculate Next Available NumberThis formula will calculate the next available number.FormulaRlatulippe@romac.com04/19/2000
Refresh Authors or Readers Fields Updated via LotusScript Back-endLotusScriptRlatulippe@romac.com04/19/2000
Force form check on creation of response doc.This checks the current form you are on and ensures that it is viable for the response form to be createdLotusScriptRlatulippe@romac.com04/19/2000
How do you remove an element from a Textlist field?How do you remove an element from a Textlist field?LotusScriptRlatulippe@romac.com04/19/2000
FTP MirrorCreated By: Teresa Deane on 02/07/96 at 03:59 PM
Category: Miscellaneous Minimum required Notes: Notes 4.0
Author: Teresa Deane
Company: Iris Associates
E-Mail Address: InterNotes@iris.com Description of the Agent: This agent refreshes pages with attachments. It should be run in the background preferably after the refresh agent has run.
LotusScriptRlatulippe@romac.com04/19/2000
UserNameObject propertyThis agent gets a Name object for the current user and prints the common user name.JavaRlatulippe@romac.com04/19/2000
Retrieving the Names of all the Columns in a View using NotesView property, ColumnsThe example below will retrieve each column in the Intermediate view. The column title will be displayed if it exists, otherwise the user will be notified on the lack of a column title.LotusScriptRlatulippe@romac.com04/19/2000
Building a Searchformula$ using several fields amd @IsMemberBuilds a search where Form = "ServerAdmin" and either of the DefaultClass field or OtherClassNames list field = the variable sClassLotusScriptRlatulippe@romac.com04/19/2000
Updating Parent when Child changes A Notes formula for updating parents when a child
changes in Notes R3/4.
Updating Parent when Child changes A Notes formula for updating parents when a child changes in Notes R3/4.FormulaRlatulippe@romac.com04/19/2000
Making a Notes newsletter1. This agent creates a newsletter consisting of links to all the documents in the current database that contain the word "arachnid" and mails the newsletter to the current user.JavaRlatulippe@romac.com04/19/2000
Lotus Notes OLE Automation with MS ExcelThis demo uses OLE automation to create Notes mail from within Microsoft Excel, sending cell values in the body of the mail message. This is a great and easy-to-write example of how to use the Notes client with MS Office products, using the best of both products. You can cut and paste this VBA code example into Excel.LotusScriptRlatulippe@romac.com04/19/2000
Create error handling classLotusScriptRlatulippe@romac.com04/19/2000
Do not save a field if the user's leaves it blankFormulaRlatulippe@romac.com04/19/2000
Compose a New Document With Inheritance When Current Document is OpenIf you are composing a document, and want to create a new document that inherits information from the currently open document, then you need to save the currently open document, and then compose the new one. Using this formula will let you save the existing open document without closing it, and then compose a second document that may inherit values from the first.FormulaRlatulippe@romac.com04/19/2000
NotesUIDocument method, SaveSave the on screen document that is set to a NotesUIDocument variable, use the NotesUIDocument method, Save .LotusScriptRlatulippe@romac.com04/19/2000
Determine the number of seconds, hours, minutes, days and weeks between now and a particular date?The following sample script determines and displays the numbers of seconds, minutes, hours, days and weeks between now and both the start of the next year and the start of the current year. You can modify the script to compute the difference between the current date and any user-defined date.LotusScriptRlatulippe@romac.com04/19/2000
DB Lookups and Keyword FieldsIn order to set a default value for a keyword field when the formula was used
to defined the keyword selection, follow this tip: For the default value of the keyword use the formula below. Then all you have to do is make the first value of your List that you are looking up be the default value. Beware that if the key you use to do the Lookup is not present when composing, you will not have a default value.
FormulaRlatulippe@romac.com04/19/2000
Date Computation FormulaThe formula calculates the difference in Years between two Dates. For example, the formula below calculates your Age by subtracting Today's date from your Birthday. Don't forget to add your Birthday field to a form or it won't work.FormulaRlatulippe@romac.com04/19/2000
Convert Month Number to Month NameThe following code will convert a Month number to the corresponding Month long name.FormulaRlatulippe@romac.com04/19/2000
API Call to User32 to get and Set Active Window TitleGets the Active Windows Title using WIN32 library calls.LotusScriptRlatulippe@romac.com04/19/2000
How to Use @DbCommand to Access More Than One Column of DataBy concatenating multiple @DbColumn formulas, however, you can return multiple columns of data.FormulaRlatulippe@romac.com04/19/2000
How to Return Background or Hyperlink Images via $$Return field in DominoThe following code retrieves the values from the fields named Fname (First Name) and Lname (Last Name) and returns it to the browser when a person submits the form. The code also uses the graphic image 3.jpg as the background image and the graphic image R.gif as a hyperlinked image to the Lotus web site.FormulaRlatulippe@romac.com04/19/2000
Running @Command on Multiple DocumentsThe @Command function can only be run on one document at a time (i.e., You cannot select two or more documents that Compose a document for each of them). In order to use this command on multiple documents, follow these procedures:FormulaRlatulippe@romac.com04/19/2000
Assign Next Consecutive Number (Uses Environment Variable)In the default value of a field, use this formula to assign the next consecutive number using an environment variable:FormulaRlatulippe@romac.com04/19/2000
Make a view to use for checking for replication conflicts?Make a view to use for checking for replication conflicts.FormulaRlatulippe@romac.com04/19/2000
Opening a document from a buttonTo open a document from a button, in read mode, follow this formula For Example: If you would like to put a button on a Company form that will allow you to pick from a list of names associated with that company, and open the person's entry in read mode;FormulaRlatulippe@romac.com04/19/2000
NotesDocument property .AuthorsRetrieves the authors of a given document in a Notes document by using the NotesDocument property . Authors .LotusScriptRlatulippe@romac.com04/19/2000
Factorial FunctionReceives nFact as the user input plus additional parameters for displaying each factorial between zero and nFact as well as the number of recursive calls. The function returns the factorial of nFact .LotusScriptRlatulippe@romac.com04/19/2000
Social Security FormatLotusScriptRlatulippe@romac.com04/19/2000
How to Delete Profile Documentshe only way to delete a profile document we've been able to find is to use the remove method in the NotesDocument class.LotusScriptRlatulippe@romac.com04/19/2000
Creating a Domino agent to count the number of hits on a web pageCreating a Domino agent to count the number of hits on a web pageLotusScriptRlatulippe@romac.com04/19/2000
Remove all occurrences of a character from a stringEg: to remove all the letters "x", "y" and "z" from a text field (plain text only, not rich text!)FormulaRlatulippe@romac.com04/19/2000
cuqxuabkqpnsl <a href="http://ahhhyieehvbo.com/">ahhhyieehvbo</a>, [url=http://laubhwvnapug.com/]laubhwvnapug[/url], [link=http://pvgtilmrbzat.com/]pvgtilmrbzat[/link], http://wjapxtymshuq.com/Formula,HTML,JavaScript,ActiveX/OCX/OLEAnonymous03/04/2015
Accessing Notes View PropertiesYou can access Notes view properties using the NotesView class properties.LotusScriptRlatulippe@romac.com04/19/2000
API Call to Retrive Local Time (Win95 & WinNT)Uses the function GetLocalTime in the Kernel32.DLL to retrive Time.LotusScriptRlatulippe@romac.com04/19/2000
CurrencySymbol, IsCurrencySpace, and IsCurrencySuffix propertiesThe following agent displays the currency international settings: the currency symbol; whether a space is between the currency symbol and the number; whether the currency symbol follows the number.JavaRlatulippe@romac.com04/19/2000
Examples: EnableRole method for a single userThis script enables the Auditor role for Bill Ehrhardt, in the database DISCUSS.NSF.LotusScriptRlatulippe@romac.com04/19/2000
IsOverwriteFile property2. This agent script sets the IsOverwriteFile property to true if the agent last ran over seven days ago. If the agent last ran within the last seven days, it sets the IsOverwriteFile property to false.JavaRlatulippe@romac.com04/19/2000
AlphaQuickSort FunctionSorts an array of alphanumeric elements. The function returns an array of the elements sorted alphanumerically.LotusScriptRlatulippe@romac.com04/19/2000
EffectiveUserName propertyThis script prints the current effective user name.JavaRlatulippe@romac.com04/19/2000
Date Routines in LotusScriptThis routine returns the first date a specificed weekday falls in the year when passed a year and weekday.LotusScriptRlatulippe@romac.com04/19/2000
API Calls in Script Library to write to and from Windows ClipboardScript to write to the windows clipboard.LotusScriptRlatulippe@romac.com04/19/2000
Update the parent document from response doc.It will check the document is being saved and if a field exist called $Ref (which is on reponse docs) it will look at the parent and change the "Status" field to "Updated"LotusScriptRlatulippe@romac.com04/19/2000
OpenFileLog method2. This agent opens a file called over.TXT in the Notes directory. Each action and error gets appended to the file on a separate line after first writing over the existing contents of the file.JavaRlatulippe@romac.com04/19/2000
Agent to copy all documents from a Target Db to your DbCopies all documents from another database to the current databaseLotusScriptRlatulippe@romac.com04/19/2000
unprocessedSearch methodThis example searches all or selected documents for documents created after January 1, 1997 that contain "botany" in the Subject field, and places them in the "Botanist's Delight" folder.JavaRlatulippe@romac.com04/19/2000
12-digit "unique" number based on date&timeThis formula creates a 12-digit document number...FormulaRlatulippe@romac.com04/19/2000
Sum a List of ValuesConcept
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. A little more 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. 1:1:1:1:1:1:1:1:1:1
1:1:1:1:1:1:1:1 1:1
1:1 1:1:1:1:1:1 1:1 1:1 + 1:1
2:2
Now concatenate the new list with the leftover list
2:2:1:1:1:1:1:1 Limits
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. Only 8192 numbers will fit into 64k. 2: A field on a form has the same limit. I've found that the fact of being a list also takes some of that 64k space and further limit the number of elements. Formula
Put the list in a field called values and pass it to the formula
FormulaRlatulippe@romac.com04/19/2000
How to use LotusScript to Mail a Memo with a Doclink to the Original Document.How to use LotusScript to Mail a Memo with a Doclink to the Original Document.LotusScriptRlatulippe@romac.com04/19/2000
Evaluate method2. This agent applies the @Sum @function to the Amount field (which allows multiple values) in each document and prints the result.JavaRlatulippe@romac.com04/19/2000
Auto-launching attachments in Win32Launches an attachement.LotusScriptRlatulippe@romac.com04/19/2000
LotusScript Notes AppendRTItem Method - Copy RichtextItem Font InformationLotusScript Notes AppendRTItem Method - Copy RichtextItem Font InformationLotusScriptRlatulippe@romac.com04/19/2000
Documentation and implementation notes.Documentation and implementation notes.LotusScriptRlatulippe@romac.com04/19/2000
Flexible lookups, adding keywords "on the fly"The formula below does a lookup to the same database using a hidden view. This allows flexibility because you can enter a word (that now becomes a permanent part of the lookup), or use an existing word (that will always first appear in the lookup).FormulaRlatulippe@romac.com04/19/2000
Flat file importThe routine demonstrates flat file importing with LotusScript. It shows how to read a comma
separated file. To make it more interesting it then merges the results into existing records in the database. These records
are keyed on a unique id. You should be able to easily modify this routine to create instead of merge or perhaps do both depending
on if the record already exists or not.
LotusScriptRlatulippe@romac.com04/19/2000
Determine the Number of Rows in a LS:DO Result Set in Notes R4Fetch all the rows using the LastRow method and then use the NumRows property to return the
number of rows in the result set.
LotusScriptRlatulippe@romac.com04/19/2000
Multiple "OR" conditions in SELECT StatementHere are two alternatives to using multiple OR statements.FormulaRlatulippe@romac.com04/19/2000
How to View on the Screen a Rich Text Item Added via LotusScriptHow to View on the Screen a Rich Text Item Added via LotusScriptLotusScriptRlatulippe@romac.com04/19/2000
Updating the backend NotesDocument in the QueryOpen Event.When the QueryOpen event is triggered, the Notes document is already loaded into the memory but nothing is displayed on the screen yet. You can take this chance to change the values of some of the fields. For example, you can count how many times a document has been opened (or who opened it) without having to put the document into edit mode.LotusScriptRlatulippe@romac.com04/19/2000
Another Hit Counter Using Profile DocumentsDoesn't create unique fieldnames for each document that you are counting (i.e. creates unique documents instead). Stores both the first access date and the last access date. Doesn't increment the counter unless it is accessed by a web user (this prevents ultiple increments from happening when editting a document internally while still allowing internal users to view the count info)FormulaRlatulippe@romac.com04/19/2000
How to Use LotusScript to Prevent a User from Opening a ViewHow to Use LotusScript to Prevent a User from Opening a ViewLotusScriptRlatulippe@romac.com04/19/2000
Simple Test for Reading from an ODBC Data Source Using LotusScriptThe following test script will evaluate whether you can read from an ODBC source using
LotusScript
LotusScriptRlatulippe@romac.com04/19/2000
API Call, How to Make Windows API Calls, Taking the Windows Version into AccountWindows API calls usually differ, depending upon the Windows version that is in use when the call is made. The following example illustrates how to call the Windows API GetPrivateProfileString function while taking into account the Windows version in use:LotusScriptRlatulippe@romac.com04/19/2000
What week is it?Some applications require calculations based on the week of the year. Here's the ISO standard on week calculations: "Numerical representation of a period of seven calendar days, starting with Monday and numbered from 01 to 53, with
number 01 assigned to the first week containing at least four days of the new year, and preceded by the letter "W" if needed in order to avoid misunderstanding."
FormulaRlatulippe@romac.com04/19/2000
Keyword formula to lookup a value in a view and return to fields to the keyword list.This formula reformats the user name as last name, comma, first name, taking care to handle hierarchical names. The formula looks up the reformatted user name in the Phone Numbers view of the current database and returns a list consisting of the values found in columns 2 and 3.FormulaRlatulippe@romac.com04/19/2000
Conditional Branching: The Select Case StatementThe Select Case statement allows a program to conditionally execute statements based on any number of conditions.LotusScriptRlatulippe@romac.com04/19/2000
Automated Outlook Mail agent!This agent takes the e-mail field from selected documents and displays the MS Outlook mail template with the To: Field populated with those addresses.LotusScriptRlatulippe@romac.com04/19/2000
Owner propertyThis example prints the name and common owner of all the agents in the current database.JavaRlatulippe@romac.com04/19/2000
Move Orphan documents to Orphans FolderMoves all Orphan Documents to a folder called OrphansLotusScriptRlatulippe@romac.com04/19/2000
How do you do a data import/merge using Lotuscript?How do you do a data import/merge using Lotuscript? This function can be placed in an action button in a database:LotusScriptRlatulippe@romac.com04/19/2000
Execute DOS commands from a formula?Execute DOS commands from a formula!FormulaRlatulippe@romac.com04/19/2000
Dynamically select documents per user without using a
ReaderNames field?
Dynamically select documents per user without using a
ReaderNames field?
FormulaRlatulippe@romac.com04/19/2000
Generate Response Docs (1 at a time)This macro generates response documents but only one at a time. It could be made to become a "looping" macro, but I advise against that since looping macros in Lotus 4 crashes Notes when run in a 16 bit environment. Anyway, see the Lotusscript version of this if you want "looping". This macro is nice because, even though it generates the response doc one at a time, it is still quicker than manually generating a response document.FormulaRlatulippe@romac.com04/19/2000
Update two fields on the main document from two fields entered on this latest response document.?A button macro on the Main Document to compose a new response has the following formula:FormulaRlatulippe@romac.com04/19/2000
Script Libraries - ExamplesScript Libraries - ExamplesLotusScriptRlatulippe@romac.com04/19/2000
Using LotusScript to Write to a Non-Notes DatabaseUsing LotusScript to Write to a Non-Notes DatabaseLotusScriptRlatulippe@romac.com04/19/2000
IsPublic propertyThis script counts the number of public and personal agents in the current database.JavaRlatulippe@romac.com04/19/2000
Check to see if this is an existing ID to allowing user to continueCheck ID field to ensure that the ID being eneterd does not already exist.LotusScriptRlatulippe@romac.com04/19/2000
Delete all orphaned response documentsDeletes all Orphaned response documentsLotusScriptRlatulippe@romac.com04/19/2000
What are Properties in LotusScript?Properties in LotusScript? How are they used?LotusScriptRlatulippe@romac.com04/19/2000
OpenNotesLog method1. This script opens AGENTLOG.NSF on the current computer. Each time an action or error is logged, a new document gets created in AGENTLOG.NSF.JavaRlatulippe@romac.com04/19/2000
OpenFileLog method1. This agent opens a file called append.TXT in the Notes directory. Each action and error gets appended to the file on a separate line without writing over the existing contents of the file.JavaRlatulippe@romac.com04/19/2000
Import information from a Word document into a Notes documentThis script imports information from a Word document into a Notes document while standardizing the doc's formatting.LotusScriptRlatulippe@romac.com04/19/2000
Importing text file into notes using Lotus ScriptCreate a price list in notes from a comma separated file. Each line was one document.LotusScriptRlatulippe@romac.com04/19/2000
Track who changed a critical field.How do you track who changed a critical field?FormulaRlatulippe@romac.com04/19/2000
LastRun propertyFor each agent in the current database, this example prints its name and the last time it ran.JavaRlatulippe@romac.com04/19/2000
Prompt User To Pick A Document To ComposeThis fomula prompts a user to pick from a list of available forms to create a document. When used in a button, Notes will prompt the user with a list of available forms to pick from .FormulaRlatulippe@romac.com04/19/2000
DB Column (same server)This is a standard way to perform an @DbColumn.FormulaRlatulippe@romac.com04/19/2000
Function GetParentDocument( doc As NotesDocument )This is a recursive function. It returns the main document at the top of a thread. An example of a thread is a main topic with multiple response documents. Passing the NotesDocument object reference variable to this function would return the main topic at the top of the thread. Call this function using GetParentDocument(doc).LotusScriptRlatulippe@romac.com04/19/2000
Hierarchical ReaderNames Lookup Implementing control of hierarchical ReaderName relationships in Notes R3/4Hierarchical ReaderNames Lookup Implementing control of hierarchical ReaderName
relationships in Notes R3/4
LotusScriptRlatulippe@romac.com04/19/2000
Moving file attachments added via the web to a RT field using $$QuerySaveAgentMoving file attachments added via the web to a RT field using $$QuerySaveAgentLotusScriptRlatulippe@romac.com04/19/2000
Formula for DBLookup and Prompt Box ChooseFormula for DBLookup and Prompt Box ChooseFormulaRlatulippe@romac.com04/19/2000
Toggling view action buttonsEver have a situation where you have too many buttons in the view action bar? Using a toggling mechanism helps to "compartamentalize" view action buttons according to their functionality. For example, in a sales application, you may have buttons that would help display only profiles, such as company or contact. You also may have buttons to display actions, such as creating letters, or new contacts.FormulaRlatulippe@romac.com04/19/2000
Fibonacci Sequence of n using recursionReturns F ibonacci Sequence of n using recursionLotusScriptRlatulippe@romac.com04/19/2000
This button formula is part of a navigator. The script prompts the user and opens a view selected by the user.This button formula is part of a navigator. The script prompts the user and opens a view selected by the user.FormulaRlatulippe@romac.com04/19/2000
Refresh a View from within a Document Using Script in Notes R4To refresh a view from within a document, you must perform both the backend NotesView Refresh and the frontend NotesUIDocument ViewRefresh methods (before exiting out to the view)LotusScriptRlatulippe@romac.com04/19/2000
Creating a Search Agent to Search the InternetCreating a Search Agent to Search the InternetLotusScriptRlatulippe@romac.com04/19/2000
CommonUserName propertyThe following agent prints the common user name.JavaRlatulippe@romac.com04/19/2000
Working with the Windows APIIn developing advanced applications, it's often important to access functions of the operating system. This is an example of calls to the registry.LotusScriptRlatulippe@romac.com04/19/2000
Retrive one level of Child Documents from Parent Documenst using GetChild.The example below will demonstrate how to retrieve information from a parent document, along with any child (response) documents associated with the parent document.LotusScriptRlatulippe@romac.com04/19/2000
How do you total a column at the bottom of a view?Using @DbColumn returns the total at the bottom of a viewFormulaRlatulippe@romac.com04/19/2000
JavaScript function getFieldValueThis function will return the field value (or value list) based on the element typeJavaScriptRlatulippe@romac.com09/15/2000
Select Case with Enum valuesYou can get this to work by treating the Enums as strings. In particular, see the modified script below.LotusScriptRlatulippe@romac.com04/19/2000
@DbColumn(ODBC)FormulaRlatulippe@romac.com04/19/2000
Update Oracle records via LotusScript agentThis database keys on a record in Oracle and then updates the record from the notes Document.LotusScriptRlatulippe@romac.com04/19/2000
UserName propertyThe following agent prints the user name.JavaRlatulippe@romac.com04/19/2000
Displaying Domino hit Counter Values in Profile DocumentsAuthorThe profile documents are a new feature requiring Notes 4.5 to use, set, display, etc. There is no way I know of to select profile documents for use in a view. However, it was fairly simple to write an agent that displays all the counter fields in a profile doc ument. The agent can also be used from the web. Here is the sample agent I have been using (long lines wrapped and you must "unwrap" them to try the agent:LotusScriptRlatulippe@romac.com04/19/2000
EKDOCLOC.LSS - Function LibraryEKDOCLOC.LSS - Function LibraryLotusScriptRlatulippe@romac.com04/19/2000
Phone Number Input TranslationThis formula will take any US phone number in any format, and change it to (###) ###-#### format.FormulaRlatulippe@romac.com04/19/2000
Pulling a Value From Current Table Cell With LotusScriptThe following script retrieves the contents of the currently selected cell, rounds it to two decimals,
and then writes is back to same cell. This assumes that the data in the cell is numeric.
LotusScriptRlatulippe@romac.com04/19/2000
Can you start a program in Notes and wait for it to finish?Starts a program in Lotos NotesLotusScriptRlatulippe@romac.com04/19/2000
Close methodThis agent opens and then closes a mail log. When the close method is called, the log is mailed.JavaRlatulippe@romac.com04/19/2000
JavaScript failContains functionThe JavaScript failContains function looks like this:JavaScriptRlatulippe@romac.com04/19/2000
Validate The Number of Digits in a FieldIf you have a field (in this case called partNumber) which should contain a value (such as a part number) which must be of a particular length, then use this type of formula in the validation formula to check the field to make sure the correct number of digits has been entered.FormulaRlatulippe@romac.com04/19/2000
QueryDocumentDelete Event. When a document is selected for deletion delete all response and response to response documents as well.If a document selected for deletion has response it warns the user that those will also be deleted. It then pushes all response documents and response to response into a delete folder.LotusScriptRlatulippe@romac.com04/19/2000
How to Change the Caption on a Multi-line LotusLabel in LotusScriptThe following sample script places the caption "This is a test. This is only a test." on two lines.LotusScriptRlatulippe@romac.com04/19/2000
Changing field values during testing.Here are a quick set of agents that can help you when developing/testing/implementing an application. They allow you to specify a field at the view level and change it on selected documents.FormulaRlatulippe@romac.com04/19/2000
Conditional Branching: The WHILE StatementWhile loops execute code conditionally.LotusScriptRlatulippe@romac.com04/19/2000
How to Check via LotusScript Whether a Document is Open in Preview PaneHow to Check via LotusScript Whether a Document is Open in Preview PaneLotusScriptRlatulippe@romac.com04/19/2000
Share scripts among elements in a database
Share scripts among elements in a databaseLotusScriptRlatulippe@romac.com04/19/2000
How do I get the week ending date for a specific day?Returns week ending day for a specific date.FormulaRlatulippe@romac.com04/19/2000
Selection Formula for document collection used in db.searchThis formula will be used by db.search method to select documents by form and by fields that are equal to some variable sPrimary.LotusScriptRlatulippe@romac.com04/19/2000
Reference other databasesLotusScriptRlatulippe@romac.com04/19/2000
Error 4000Notes Error.No mail sent.LotusScriptAnonymous03/12/2002
Validate Social SecurityTry the following code to validate your social security number.LotusScriptRlatulippe@romac.com04/19/2000
AddressBooks propertyThis program prints the server name (or "Local"), file name, and title of all the address books known to the current session.JavaRlatulippe@romac.com04/19/2000
Open a view in full screen mode from a Navigator.Open a view in full screen mode from a Navigator.FormulaRlatulippe@romac.com04/19/2000
Send Fax Mail as HIGH PriorityField name is DeliveryPriority. Checks to see if last domain listed on Sendto field is Fax. If yes, then send high priority.FormulaRlatulippe@romac.com04/19/2000
IsEnabled property2. This example enables the agent named "Agent To Enable" if it exists in the current database.JavaRlatulippe@romac.com04/19/2000
SavedData propertyThis example uses the save data record to find the maximum weekly sales.The data records have Weeky_Sales and Name fields. The saved data record has MaxSales and MaxSales_Salesperson fields. The data record fields replace the agent record fields whenever Weekly_Sales is greater than MaxSales.JavaRlatulippe@romac.com04/19/2000
Retriving Parent and Child Documenst from a ViewThis example demonstrates how to retreive a parent document from a view, and then proceed to retreive information from all of the Parent's child documents.LotusScriptRlatulippe@romac.com04/19/2000
NotesDBDirectory classThe example below retrieves all databases included in the data directory and any directories below the data directory, and displays their titles.LotusScriptRlatulippe@romac.com04/19/2000
NotesUIDocument property, EditModeForces the on screen document into edit mode, using the NotesUIDocument property, EditMode .LotusScriptRlatulippe@romac.com04/19/2000
Compiling and running a Java programThe following examples demonstrate the minimal code needed for a Java program that uses the Notes classes. The examples instantiate a Session object and print the String output of its getPlatform method (Platform property). 1. This is a stand-alone program that extends the NotesThread class:JavaRlatulippe@romac.com04/19/2000
Determine if a document is a profile documentWith the advent of profile documents in Notes 4.5, it will become neccessary to determine if a document is a profile document or not. A new NotesDocument property, IsProfile, will return True if a document is a profile document, and False if it is not. To use IsProfile, set the document in question to a NotesDocument object, and retrieve the value in the property. Syntax variablename = notesdocument.IsProfile The example below will determine if this document is a profile document or not, and display a message with the result.LotusScriptRlatulippe@romac.com04/19/2000
Calculating array values in JavaScriptThis JavaScript function uses a global variable listSize which is computed from the formula @Elements(someList). The list is really an array of <INPUT> fields called total and quantity. Note that if the array has only one element you cannot use the array construct, you must reference the field directly.JavaScriptRlatulippe@romac.com07/08/2000
Format Phone Number FieldsThis formula will automatically format phone number field entries in which the user does not enter dashes between the area code, prefix and suffix. For example, if a user types 4077888561, Notes will convert the number to 407-788-8561. This formula is ideal if you are importing information from another database in which phone number formatting was not used, or you just want to assist your users in properly formatting a phone number. This is just an example used to illustrate the use of formulas to format text: your formula may take on some additional characteristics depending on the phone number lengths, formatting needs, etc. that are typically entered by the user in an "ideal world" situation.FormulaRlatulippe@romac.com04/19/2000
A very forgiving date parser. Let's you enter dates like Nov. 1, 1990A very forgiving date parser. Let's you enter dates like Nov. 1, 1990FormulaRlatulippe@romac.com04/19/2000
Agent to set Readers field security using IsReaders property.This agent is used to reset a readers field once it has been changed to a type text.LotusScriptRlatulippe@romac.com04/19/2000
Retriving Parent Documents with Child and Grandchild DocumentsThis example demonstrates how to retrieve information from a parent document in a view, and all of the Parent's child and grandchild documents.LotusScriptRlatulippe@romac.com04/19/2000
Delete a default zero after a form is opened when the field is being calculated in another fieldThis code is used to to delete a default zero after a form is opened when the field is being calculated in another field. This code should go in the Postopen mode of the form.LotusScriptRlatulippe@romac.com04/19/2000
Displaying the Date in YY/MM/DD FormatIf you need to display the date in a YY/MM/DD format, use the following formula:FormulaRlatulippe@romac.com04/19/2000
Creating a Search AgentCreating a Search AgentLotusScriptRlatulippe@romac.com04/19/2000
Assign Navigator on Database open.The following is used in the PostOpen event of the Database Script to assign a Navigator and View depending on the users Role.FormulaRlatulippe@romac.com04/19/2000
Credit Card Verification FormulaA Luhn formula (Mod10) for credit card number verification, The main purpose of this algorithm is to avoid data entry errors, but it can also be used as a security tool. But BEWARE, it's a very weak security tool, that anybody can crack !LotusScriptRlatulippe@romac.com04/19/2000
IsPublic propertyThis script counts the number of public and personal agents in the current database.JavaRlatulippe@romac.com04/19/2000
How do you do a data import/merge using Lotuscript?How do you do a data import/merge using Lotuscript? This function can be placed in an action button in a database:LotusScriptRlatulippe@romac.com04/19/2000
Creating NewslettersCreating NewslettersLotusScriptRlatulippe@romac.com04/19/2000
Replacement class for SessionReplaces lotus.notes.Session classJavaRlatulippe@romac.com04/19/2000
lotus.notes.DateRange class2. This example sets the StartDateTime and EndDateTime properties of a lotus.notes.DateRange object through the property methods, then displays the value of the Text propertyJavaRlatulippe@romac.com04/19/2000
Creating a databaseCreates a databaseLotusScriptRlatulippe@romac.com04/19/2000
Arrays and RedimArrays, like variables, hold values of a single data type. Unlike variables, however, arrays can hold multiple elements of the same data type.LotusScriptRlatulippe@romac.com04/19/2000
How to make the "loser" of a replication/save conflict be the "winner"?When you select the "loser" document and run this agent, it will be promoted to be a replication "winner". You can then delete the original "winner" document. Put this code into an agent that runs on selected documents:LotusScriptRlatulippe@romac.com04/19/2000
CommonOwner propertyThis example prints the common owner name of the current agent.JavaRlatulippe@romac.com04/19/2000
Sorting Lists of NumbersThis formula will sort a list of numbers with these limits: - Largest Number can be 9,999,999.99
- Largest number of elements is approximately 8000
- Decimal accuracy to 2 digits. These are the general limits. The formula will actually handle 9 numbers and 1 decimal "." per element.
FormulaRlatulippe@romac.com04/19/2000
What are the Unix syntaxes for calling DLLs from LotusScript?LotusScriptRlatulippe@romac.com04/19/2000
If you use the LotusScript Evaluate statement with certain @functions, the result is not what you expected.The Evaluate statement is designed to work with non-UI @functions only. The following @functions cannot be used with the Evaluate statement:LotusScriptRlatulippe@romac.com04/19/2000
API Call to NNOTESWS.DLL to get and Set Active Window TitleThis example demonstrates the declaration of the NEMSetWindowText function located in NNOTESWS.DLL file:LotusScriptRlatulippe@romac.com04/19/2000
Concatenate multiple keyword fields for a viewFormulaRlatulippe@romac.com04/19/2000
Prompt Users For A View To Select From A Navigator HotspotYou can use this formula to prompt a user to select which view they want to see when they click on a hotspot of a navigator, (or from a button or action button).FormulaRlatulippe@romac.com04/19/2000
Adding an Item to All Documents Using AppendItemValue of NotesDocumentAdding an Item to All Documents Using AppendItemValue of NotesDocumentLotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Newsletter class1. This agent performs a full text search on the current database and creates a newsletter. The agent formats a newsletter message containing a link to each matching document and sends it to the current user.JavaRlatulippe@romac.com04/19/2000
Field SynchronizationWhen trying to set one field equal to another when the document is loaded into memory, for example, if you want to set FieldX equal to FieldY so that if FieldY is changed, and they will be equal again when the document is reloaded, follow this tip:FormulaRlatulippe@romac.com04/19/2000
16 bit GetPrivateProfileString function call to get ScreenSaver and WallPaper in Windows.Returns Screen Saver and Wallpaper settings on Windows system.LotusScriptRlatulippe@romac.com04/19/2000
Calendar Pop-UpThe formula below is a pop-up calendar that can be placed behind an icon. A working example of this function can be found in the Client Service Call Tracker application. Make sure you select "Formula" in the pop-up window for this to work. Click on icon below for demo :FormulaRlatulippe@romac.com04/19/2000
Multiple @Prompt EvaluationsWhen prompting a user and the next prompt is contingent on making an initial selection and not selecting CANCEL, follow this formula:FormulaRlatulippe@romac.com04/19/2000
4. Clear ButtonThis formula is the fourth of a series -- for a set of four buttons: SELECT, ADD, EDIT, and CLEAR. These are simple formulas but they allow you to have a multi-value field showing a list of names (or of any text items) which you can initialize by selecting, add to, edit, or clear. The third button, CLEAR, very simply clears the field ReaderList. It would not be necessary to have such a button, except that you cannot de-select ALL names in the multivalued list box shown by the EDIT button.FormulaRlatulippe@romac.com04/19/2000
lotus.notes.Log class3. This example opens a Notes log and logs an error. The database agentlog.nsf must be based on the StdR4AgentLog template.JavaRlatulippe@romac.com04/19/2000
Implode FunctionThis function takes in a Notes Item in the signature line and returns the item as a string value the values are separated by a comma but that can be changed to any delimiter the user wishes to use. Additional checks for author and such may also be incorporated if the developer so feels.LotusScriptRlatulippe@romac.com04/19/2000
View Count analysisEnables the ability to allow Notes to send an email massage when someone opens a view. Great for doing an analysis on who uses a particular view and how often. Since this goes to your mail file, can create folders specific to the analysis so the data can be better presented.FormulaRlatulippe@romac.com04/19/2000
Phone # LookupUsers are prompted for a first and/or last name to lookup. The script searches local and public address books and returns each name found in it's own window displaying the full name, department, and office phone number.LotusScriptRlatulippe@romac.com04/19/2000
Mail notification that a new document was created from a web client.Web mail notification that a new document was created from the web.LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.DateRange class4. This example sets a value for a lotus.notes.DateRange object, then changes the lotus.notes.DateTime object that the EndDateTime property is based on. This implicitly changes the EndDateTime property.JavaRlatulippe@romac.com04/19/2000
Purge AgentCreated By: Teresa Deane on 02/07/96 at 03:58 PM
Category: System Minimum required Notes: Notes 4.0
Author: Teresa Deane
Company: Iris Associates
E-Mail Address: InterNotes@iris.com Description of the Agent: This agent manages the database size based on selections in the administration note. It is set to run at 1:00AM nightly. It is a system agent which ships with the Web
Navigator template. Please refer to the Web Navigator Administration Guide for more information. Agent Script:
LotusScriptRlatulippe@romac.com04/19/2000
Access the names of users in a specific group in the Domain Address Book using formulas. Access the names of users in a specific group in the Domain Address Book using formulas.FormulaRlatulippe@romac.com04/19/2000
lotus.notes.Name classThis example displays properties of lotus.notes.Name that are not null.JavaRlatulippe@romac.com04/19/2000
Compute With FormThis agent runs on a selected document. When run it "recomputes" the form. I use this a lot when I need to change something like a reader field that is computed when composed. Instead of adding an additional readers field to a form and then modifying each form this will allow you to recompute the values of such fields after you have changed the field formula. This is handy especially if you forget to give yourself access to certain fields (in which case you have to run this at the server) but it can save a lot of time and heartache.LotusScriptRlatulippe@romac.com04/19/2000
NotesVersion propertyThis program displays the version number of Notes installed in the local Notes directory.JavaRlatulippe@romac.com04/19/2000
What's the date of the Last Thursday in November?In the following function getdateByWeekDayFromBack(1998,11,1,5) returns the last Thursday of Nov.LotusScriptRlatulippe@romac.com04/19/2000
Windows directoryReturns the Windows directoryLotusScriptRlatulippe@romac.com04/19/2000
This button formula is useful in a mail message to a group of persons.When the recipient clicks the button, the script sends a mail message
indicating "Yes" or "No" for the "RSVP." For testing, the name of the current user is used--in practice, you can use your name.
FormulaRlatulippe@romac.com04/19/2000
Sort - QuickSort, IBMsThe following is an example of how to use LotusScript code within NotesViP
to sort an array.
LotusScriptRlatulippe@romac.com04/19/2000
Add Rich Text thru the UILotusScriptRlatulippe@romac.com04/19/2000
Accessing Notes agentsThis example sends a memo to the managers of the current database containing the name and comment of each agent in the database.JavaRlatulippe@romac.com04/19/2000
How to Append One RTItem to Another via LotusScript Without a Save PromptHow to Append One RTItem to Another via LotusScript Without a Save PromptLotusScriptRlatulippe@romac.com04/19/2000
Prevent deletion of document if response existChecks document to be deleted and prevents the deletion if a response existLotusScriptRlatulippe@romac.com04/19/2000
Conditional Branching: The FOR StatementThe For statement gives you the ability to execute a block of code a certain number of times.LotusScriptRlatulippe@romac.com04/19/2000
Equivalent LotusScript Explode functionHere is an example I use for explode: Lineinput is the string to be parsed out. Sep is the separator (unfortunately this version only supports one character separators) Linearray is the array which is where you want your values.LotusScriptRlatulippe@romac.com04/19/2000
ODBC using LS:DO to push to an Oracle database.Pushes LotusNotes data to an Oracle database!LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Log class1. This agent opens a mail log and sends it to the current user when the log closes.JavaRlatulippe@romac.com04/19/2000
Sort - Quicksort Algorithm recursiveSorts an array of data using the recursive Quicksort AlgorithmLotusScriptRlatulippe@romac.com04/19/2000
Updating Oracle database from Lotus NotesYou can use the ODBC (Open Database Connectivity) Version 2.0 standard to access data in non-Notes databases. Using formulas or scripts embedded in Notes objects, you can integrate the data from many external databases into Notes applications. For example, a customer call-tracking application in Notes can access customer financial data from an ODBC-compliant relational database management system.LotusScriptRlatulippe@romac.com04/19/2000

Formula lookup for frequently changing data
Problem: You have some data on a document that you are looking up from another. The data changes frequently and is difficult to keep synchronized. Solution: Instead of trying to manipulate the data each time it changes for hundreds of documents, make your lookups dynamic. However, lots of dynamic lookups will slow your application. Instead use this technique.FormulaRlatulippe@romac.com04/19/2000
Create and send mailIn LotusScript, to send a message in Notes requires the following type of code: Sub Click (source as Button)' a button to send info with...LotusScriptRlatulippe@romac.com04/19/2000
In one form, the user can select as many as three subforms from the list of all available subforms.Where do we get a list of subforms when we don't know from one minute to the next how many there are or what they are called? Simple, we use this LotusScript routineLotusScriptRlatulippe@romac.com04/19/2000
Good display formula for response docsFormulaRlatulippe@romac.com04/19/2000
ServerName property1. This script prints the name and server name of the current agent.JavaRlatulippe@romac.com04/19/2000
How to Determine if Optional Arguments Have Been Provided for a Method. Product Release: LSX Toolkit 2.0How to Determine if Optional Arguments Have Been Provided for a Method.LotusScriptRlatulippe@romac.com04/19/2000
Doing a DBLookup using LotusScript Notes support services has one....it uses a dummy form that has a field
for each of the parameters in a @dblookup...the dblookup field is a computed
field, and you should do the following:
LotusScriptRlatulippe@romac.com04/19/2000
List ComparisonCompare two list and return only the values not found in both list.FormulaRlatulippe@romac.com04/19/2000
API Call to Add Shortcuts to the Win95 DesktopThis script sample will add Shortcuts to the Win95 Desktop.LotusScriptRlatulippe@romac.com04/19/2000
Fibonacci Sequence of n using iterationReturns Fibonacci Sequence of n using iterationLotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Agent class1. This example prints the name of the current agent.JavaRlatulippe@romac.com04/19/2000
Removing Old Documents with an AgentThis set of Agents will update the database removing old documents. Because of the nature of background Agents, the second Agent is required to reset the status of each document. (Background Agents only run on those documents not yet processed by the Agent, so the second Agent resets a field, thus making it "new" to the first Agent on the next periodic basis) Warning: this will re-set the unread marks in the database!FormulaRlatulippe@romac.com04/19/2000
Update IsReader or IsAuthor agent when the field has been changed to a text field.LotusScriptRlatulippe@romac.com04/19/2000
API call to NNOTESWS.DLL to display Progress Barmakes API calls to display progress barLotusScriptRlatulippe@romac.com04/19/2000
Copy one Richtext field to anotherCopies richtext field from docA and writes it to docBLotusScriptRlatulippe@romac.com04/19/2000
Using UnprocessedDocuments on all newly created and modified documents, to modify the Status item of each document it processes.This agent script runs on all newly created and modified documents, and its purpose is to modify the Status item of each document it processes.LotusScriptRlatulippe@romac.com04/19/2000
Sending an e-mail message to the author of the current documentSends and E-mail to author of current document!LotusScriptRlatulippe@romac.com04/19/2000
Check and set a File's AttributesYou can check a file's attributes and then set an attribute using LotusScript. For example, the following code checks whether a file is Hidden, and if it is, sets its Hidden attributeLotusScriptRlatulippe@romac.com04/19/2000
Accessing session propertiesThis agent uses the Session properties.JavaRlatulippe@romac.com04/19/2000
Agent that prints mail as soon as it arrives Agent that prints mail as soon as it arrivesLotusScriptRlatulippe@romac.com04/19/2000
@DbLookup( ODBC)Given data source information from the ODBC.INI file, uses this information to activate the appropriate ODBC driver. The driver then locates the specified DBMS, table, and column, and returns only the values in that column belonging to records whose value in the key column matches the specified key. You can optionally specify whether the returned list of values is sorted, whether duplicate values are deleted, and how null values are handled.FormulaRlatulippe@romac.com04/19/2000
unprocessedFTSearch methodThis agent runs on all or selected documents. It puts all documents that contain the word "botany" in the folder "Botanist's Delight."JavaRlatulippe@romac.com04/19/2000
Save and Exit a DocumentUsually used in an Action button or a button in a form, this formula tells Notes to Save a document, and then exit it.FormulaRlatulippe@romac.com04/19/2000
Setting values in several documents without opening them depending on a change in a different documentchecks docs created with a second form and does a collection depending on a field value then sets the status field of teh collected docs to closed.LotusScriptRlatulippe@romac.com04/19/2000
Platform propertyThis program prints the name of the platform.JavaRlatulippe@romac.com04/19/2000
How to provide context-sensitive help for your database.How to provide context-sensitive help for your database.FormulaRlatulippe@romac.com04/19/2000
Determine whether a particular field in a form contains an object?HasItemObject checks whether the field that is passed to this function contains an Object and then returns either True (hasObject) or False. A sample script is provided below.LotusScriptRlatulippe@romac.com04/19/2000
Finding the Amount of Free Space on a Drive Using LotusScriptListed below is a LotusScript that makes the necessary API call.LotusScriptRlatulippe@romac.com04/19/2000
Check specified server until is respondsChecks for server responseLotusScriptRlatulippe@romac.com04/19/2000
Using LotusScript to Read from Non-Notes DatabasesUsing LotusScript to Read from Non-Notes DatabasesLotusScriptRlatulippe@romac.com04/19/2000
Returning a Subset of a ListThe formulas below will return various subsets of a list.FormulaRlatulippe@romac.com04/19/2000
Using UnprocessedDocuments on all unread documents, to put unread documents into a folder. This agent script runs on all unread documents, and its purpose is to put unread documents into a folder.LotusScriptRlatulippe@romac.com04/19/2000
What is the Difference Between Type and Class in LotusScript?A detailed description of both Types and Classes is below.LotusScriptRlatulippe@romac.com04/19/2000
List-processing functionsThe list-processing functions of the @formula language provide some of the strongest processing capabilities of any built in feature of Notes. Translating them to JavaScript is fairly straightforward. List in JavaScript are implemented as arrays, but you use them in almost the same way you do the @formula language. Perhaps the most obvious use of these functions on a Web page is in string parsing, but your imagination and necessity may suggest many more. Here are the JavaScript versions of some list processing functions:JavaScriptRlatulippe@romac.com07/08/2000
The replacement class for AgentContextReplaces lotus.notes.JavaRlatulippe@romac.com04/19/2000
How do you select only Response documents in a view?How do you select only Response documents in a view?FormulaRlatulippe@romac.com04/19/2000
Converting C Strings To Lotusscript StringsWhen calling Windows API functions, you usually have to pass in a fixed length buffer in which the API call returns a null-terminated (C style) string. To convert this string back to a normal LotusScript string, use the Instr function to search for Chr$(0).LotusScriptRlatulippe@romac.com04/19/2000
Updating a UIdoc in Read Mode with a DialogBoxFor a variety of reasons, such as formatting, you want to keep a document in read mode, but you need to collect input from a user and update the document they are currently reading. In this example, we want to keep the user in read mode but update the documentLotusScriptRlatulippe@romac.com04/19/2000
Creating Newsletters - Challenge*Creating Newsletters - Challenge*LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.DateRange class3. This example writes a value to the Text property, then displays the LocalTime property of the StartDateTime and EndDateTime properties (which are lotus.notes.DateTime objects).JavaRlatulippe@romac.com04/19/2000
Compose Form in Other DatabaseButton : Application request Asks if user wishes to continue, the saves audit trail information for the transaction, and launches the appropriate DB compose form Note: Notice where the @Compose is located in the button formula (at the end !!). This was necessary so the File save, window close would execute on the initiating form (Request router), not on the target compose form command.FormulaRlatulippe@romac.com04/19/2000
Using environment variables2. This agent example prints the value of a system environment variable. The second argument to getEnvironmentString is true so that a dollar sign is not prepended to the name of the environment variable.JavaRlatulippe@romac.com04/19/2000
Trim functionSimulates @Trim in JavaScriptJavaScriptDaryl Rochette11/04/1999
Sleep or Wait code'Puts the app to sleep for the given number of millisecondsLotusScriptRlatulippe@romac.com04/19/2000
How do you find out what Roles a user has in the current database?This function will give you a list of all roles a user is in, even if the user is in nested groups which are listed in the ACL.LotusScriptRlatulippe@romac.com04/19/2000
Mark Documents With Attachments With a PaperclipUse this formula in a view column to indicate that there are attachments associated with the document.FormulaRlatulippe@romac.com04/19/2000
Tracking who changed a critical fieldAdd an audit trail of the modifications made to a critical field:- In this case the field is named "PRIORITY"FormulaRlatulippe@romac.com04/19/2000
API Call to NNOTES.DLL to get User NameMakes an API call to retrive the Current User NameLotusScriptRlatulippe@romac.com04/19/2000
Debugging Notes Java CodeDebugs your Notes Java AgentsJavaRlatulippe@romac.com04/19/2000
ODBC Connection With Message Box to ask for ODBC DATA Source.During ODBC Connection gets Data Source from User.LotusScriptRlatulippe@romac.com04/19/2000
Working with Embedded Objects and Environment VariablesWorking with Embedded Objects and Environment VariablesLotusScriptRlatulippe@romac.com04/19/2000
How do you change the new mail tune under NT?How do you change the new mail tune under NT?LotusScriptRlatulippe@romac.com04/19/2000
OLE from Notes to Excel via LotusScriptCopies data from Notes to Excel using OLE automationLotusScriptRlatulippe@romac.com04/19/2000
Using UnprocessedDocuments to iterate through a view and , if the Approver item contains the current user's name, it sets the Approved item to "Yes."This view action script allows a user to approve multiple requisitions at once by processing the currently selected documents in the Requisitions view. UnprocessedDocuments returns the documents currently selected in the view. The script iterates over each document and, if the Approver item contains the current user's name, it sets the Approved item to "Yes."LotusScriptRlatulippe@romac.com04/19/2000
EKDOCLOC.LSS - Documentation and Sample UsageEKDOCLOC.LSS - Documentation and Sample UsageLotusScriptRlatulippe@romac.com04/19/2000
Creating a New and Modified - Challenge*Creating a New and Modified - Challenge*LotusScriptRlatulippe@romac.com04/19/2000
WeekEndingFormulaRlatulippe@romac.com04/19/2000
How to update a field on parent when a reponse doc has been deletedIt will check the documents that are being deleted and if a field exist called $Ref (which is on reponse docs) it will look at the parent and change the pro field to ""LotusScriptRlatulippe@romac.com04/19/2000
How do you retrieve a column total for a category?How do you retrieve a column total for a category?FormulaRlatulippe@romac.com04/19/2000
Avoid error messages with DBLookup?How do you avoid error messages with DBLookup?FormulaRlatulippe@romac.com04/19/2000
LogAction methodThis agent logs actions to a mail memo. It performs a full text search on the current database, and logs one action for each document that matches the full text search query. Each time the logAction method is called, it adds a new line to the Body item of the mail memo. For example, if FTSearch returns a collection of three documents, the body of the mail memo looks like this: 10/25/97 12:26:37 PM Botany Agent starting
10/25/97 12:26:42 PM Document Petals placed in folder. 10/25/97 12:26:44 PM Document Stems placed in folder. 10/25/97 12:26:46 PM Document Leaves placed in folder.
JavaRlatulippe@romac.com04/19/2000
How to Modify Date Format to Textual RepresentationFormats a date from 12/27/97 to December 27, 1997FormulaRlatulippe@romac.com04/19/2000
Date validation...# days between date MUST be less than X...This validation technique is from the NET support database and is used to ensure that a NET
trial installation does not exceed 60 days (otherwise, a message is displayed asking that the
end date be adjusted). In the example, Seed is the date the trial was installed, and DeSeed is the date the trial is to be
de-installed (which cannot exceed 60 days).
FormulaRlatulippe@romac.com04/19/2000
When Looping Through a ResultSet, While.NextRow Is Not RecommendedInstead of While.NextRow, use Do at the beginning of the loop and the condition at the end, with a statement
such as "Loop Until res.IsEndOfData."
LotusScriptRlatulippe@romac.com04/19/2000
Refresh AgentThis agent refreshes non-private http pages nightly at 3:00 AM provided that they have not been brought in already that day. This is a system agent which ships with the Web Navigator template. Please refer to the Web Navigator Administration Guide for more information.LotusScriptRlatulippe@romac.com04/19/2000
Retrieving Specific Help DocumentWhile in a document, there may be a need for additional help. This action uses @Picklist to pull up the help view, the user selects which help document is needed, then brings up the actual document. A simple Save & Return action button on the help doc gets the user back to their original document. Need a sorted view using a temporary variable assigned to @Picklist as the key. Found in the Worldwide Coutry Registration database.FormulaRlatulippe@romac.com04/19/2000
Scheduled agent that attaches file to documents.LotusScriptRlatulippe@romac.com04/19/2000
Sort columns by a fieldSimple way to organize docs in a view. Place to the left of the column you want to sort, and make decending. Use your own field for "Status".FormulaRlatulippe@romac.com04/19/2000
Convert a numerical value to the equivalent written text?Converts a field called NUMBER to written textFormulaRlatulippe@romac.com04/19/2000
Set SubtractionScenario: You have set A {1,2,3,4,5,6,7,8} and you have set B {1,2,3}, and you need to know what members of set A are NOT in set B. Follow this tip: Application: Very often people need to fill out timesheets or some other form on a regular basis. It's very easy to see who has filled out the required form for the required date. Just build a view. But how do you show who hasn't filled out the required form for the required date. You can't do it in a view since there are no documents to show. The solution is to calculate the names and show them in a special document created just for this purpose. Using DBLookups you can create your SetA and SetB list. SetA is a list of all the people that have ever filled out the form. The assumption is that if a person has filled out a form in the past, they must still be filling out forms (actually you can put in code to account for terminated people). Set B is created by looking up the names of people that have filled out the form for the date in question. You have an editable field for the date in question. Just enter the date, press F9. You've got your list of delinquents. You can also have a button to mail memos to the unlucky winners, to prompt them to get the required documents in on time.FormulaRlatulippe@romac.com04/19/2000
lotus.notes.Newsletter class1. This agent performs a full text search on the current database and creates a newsletter. The agent formats a newsletter message containing a link to each matching document and sends it to the current user.JavaRlatulippe@romac.com04/19/2000
Pick listButton = Computer Purchase
The following order of commands was imposed by how Notes processes different types of commands.
FormulaRlatulippe@romac.com04/19/2000
Compiling and running a Java program2. This is a stand-alone program that implements the Runnable interface:JavaRlatulippe@romac.com04/19/2000
How to Add Carriage Returns to a Text Field via LotusScript in Notes R4.5xHow to Add Carriage Returns to a Text Field via LotusScript in Notes R4.5xLotusScriptRlatulippe@romac.com04/19/2000
One time push of Notes Documents to Oracle DatabaseThis agents write notes document into an Oracle database using ODBCLotusScriptRlatulippe@romac.com04/19/2000
getEnvironmentString method1. This example gets the value of the $EnvLoc environment variable.JavaRlatulippe@romac.com04/19/2000
NotesUI classesYou can use the NotesUI classes to create a document on the fly .LotusScriptRlatulippe@romac.com04/19/2000
Examples: EnableRole method for multiple users.This sub enables one role for multiple people in an ACL. Its parameters are a NotesACL object, the name of the role to enable, and an array of strings that represent user names.LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Log class2. This agent opens a mail log, logs an action for each document in the current database, and sends the log to the current user when the log closes.JavaRlatulippe@romac.com04/19/2000
getEnvironmentString method2. This example gets the value of the MailServer system environment variable.JavaRlatulippe@romac.com04/19/2000
Making a Notes newsletter2. This agent creates a newsletter consisting of a picture of the document for each document in the current database that contains the word "arachnid." The documents are saved in Reports.nsf.JavaRlatulippe@romac.com04/19/2000
Factorial of n using iterationReturns the factorial of a number n using iterationLotusScriptRlatulippe@romac.com04/19/2000
Manipulating Rich TextManipulating Rich TextLotusScriptRlatulippe@romac.com04/19/2000
Using LotusScript to Read from Non-Notes Databases - Challenge*Using LotusScript to Read from Non-Notes Databases - Challenge*LotusScriptRlatulippe@romac.com04/19/2000
Queydocumentdelete eventWill warn user of deletion of seleted documentsLotusScriptRlatulippe@romac.com04/19/2000
Spell Check Action for a fieldHilights text in a field and performs a spell check when button is pressed.FormulaRlatulippe@romac.com04/19/2000
Add Rich Text thru the UI no views used in code!Refresh the current UI doc when an attachment is added.LotusScriptRlatulippe@romac.com04/19/2000
Sum number fields which have not been edited and
initialized
Sum number fields which have not been edited and
initialized.
FormulaRlatulippe@romac.com04/19/2000
lotus.notes.Name classThis example displays properties of lotus.notes.Name that are not null.JavaRlatulippe@romac.com04/19/2000
Column formula to detect Mail ReceiptsFormulaRlatulippe@romac.com04/19/2000
Creating a Rich Text FieldCreating a Rich Text FieldLotusScriptRlatulippe@romac.com04/19/2000
Prevent savesTo prevent saving a document. Place this in Input Validation. This is the simplest way to keep docs from being edited/saved.FormulaRlatulippe@romac.com04/19/2000
Showing different Subforms on the WebSometimes a document might be to big or to confusing to fill out as one document on the web. One way to break up this document is to create multiple subforms, and on the submit of the form change the subform and reload the page.FormulaRlatulippe@romac.com04/19/2000
Using environment variables
1. This example increments the environment variable $SeqNo by one and prints the result. (This script would not be reliable on a server for maintaining a system of sequential numbers.)JavaRlatulippe@romac.com04/19/2000
Agent used to create User Profile Documents From Office Profile DocumentsBuild a set of documents from information gathered from a different set of documents.LotusScriptRlatulippe@romac.com04/19/2000
Hide When formulaThis code will hide a field (etc) if the user doesn't have delete rights. Slight modification will allow a hide for users with out edit rights. This might be good to hide the "Edit" button when the user doesn't have edit rights.FormulaRlatulippe@romac.com04/19/2000
Button adds attachments RTFLotusScriptRlatulippe@romac.com04/19/2000
Validate that a field has alpha characters only.How do you validate that a field has alpha characters only?FormulaRlatulippe@romac.com04/19/2000
Use LotusScript to handle ordinary text filesThe following example script opens the lotus.ini file and prints out its contents to screen:LotusScriptRlatulippe@romac.com04/19/2000
Using a dialog box allow a manager to assign roles to a readers field on the fly to various documentsThis code allows a db Manager to assign various roles on the fly to a readers field on the document. The roles are called from a (GetRoles) form that is used as a dialog box to allow th euser to select various roles in the ACL.LotusScriptRlatulippe@romac.com04/19/2000
OpenMailLog methodThis agent script opens up a mail log. When the close method is called, the mail memo is sent to the owner of the agent with the name of the agent and the title of the database in the Subject.JavaRlatulippe@romac.com04/19/2000
Average the elements in a one-dimensional array of integersThis Subroutine will take and array of integers and give you the average, sum and difference from average of the integers.LotusScriptRlatulippe@romac.com04/19/2000
IsOverwriteFile property1. This script opens the over.txt file for logging. The existing contents of the file are removed before any actions or errors are logged.JavaRlatulippe@romac.com04/19/2000
@DbCommand(ODBC)Given data source information from the ODBC.INI file, uses this information to activate the appropriate ODBC driver. The driver then locates the specified DBMS, passes the specified command to it for processing, and returns the data retrieved by that command.FormulaRlatulippe@romac.com04/19/2000
Sort - Bubble Sort for a Document CollectionSorts a Document CollectionLotusScriptRlatulippe@romac.com04/19/2000
Filling Items with Dialog Box on Open of Document!Filling Items with Dialog Box on Open of Document!LotusScriptRlatulippe@romac.com04/19/2000
Find the Parent Document to a Child DocumentIn the script below, the child document is found using GetFirstDocument and GetNextDocument . You might ask yourself `Why not use GetNthDocument instead?'. The reason is GetNthDocument only works in documents in a collection, and we are working in a view!LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Session classThis agent creates a new lotus.notes.Session object and accesses its properties.JavaRlatulippe@romac.com04/19/2000
Populate Fields On Form Based On Selection of KeywordThis formula prompts the user to select a value and then populate additional fields on a form based on the selected value, (in this case to select from a list of Customer names being displayed in a view using the @DBColumn formula). This formula is typically used in a button, and is not recommended for large volumes of data that needs to be populated into a form, (use LotusScript to speed the population of data if this is a criteria).FormulaRlatulippe@romac.com04/19/2000
Parent propertyThis example prints the name of the database on which the agent is running.JavaRlatulippe@romac.com04/19/2000
Using Lists in LotusScriptLists are very powerful in LotusScript. You can use a list to get a multi-value field from a document and add the values to a list (thus ensuring uniqueness). You can then process many documents against the same list and when you are done, you will have a list of all of the values which appeared at least once in the set of documents you processed.LotusScriptRlatulippe@romac.com04/19/2000
Create Unique ID in a DocumentCreates a Unique ID for each document you compose.FormulaRlatulippe@romac.com04/19/2000
Error handling with OpenError handling with OpenLotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Newsletter class2. This agent performs a full text search on the current database and creates a newsletter. The agent formats a newsletter document for each matching document and saves it in the database Reports.nsf.JavaRlatulippe@romac.com04/19/2000
LotusScript Agent to Recalculate Documents on a ScheduleLotusScript Agent to Recalculate Documents on a ScheduleLotusScriptRlatulippe@romac.com04/19/2000
Creating a document with Authors field using LotusScriptHere's some sample code showing how to set the appropriate properties on the field. This code is run from an agent in the initialize event.LotusScriptRlatulippe@romac.com04/19/2000
Set Fields using FTGSetFieldsThe purpose of placing an "FTGSetFields" field onto a form is to provide a single location where formula's would reside that either set or modify field values. The benefit is that all of this type of code would reside in one location.FormulaRlatulippe@romac.com04/19/2000
Dependant keyword List. Final list depends on selection of second list which depends on selection of first list.FormulaRlatulippe@romac.com04/19/2000
How to use @Formula in LotusScript.How to use @Commands in LotusScript.LotusScriptRlatulippe@romac.com04/19/2000
UserNameObject propertyThis agent gets a Name object for the current user and prints the common user name.JavaRlatulippe@romac.com04/19/2000
JavaScript function trimBlanksThe trimBlanks function is a utility routine that simply takes the field value and trims any extra space values.JavaScriptRlatulippe@romac.com04/19/2000
Frameset code JavaScriptRlatulippe@romac.com07/08/2000
Deleting Fields Permanently From a DatabaseIf you are looking for a clean and easy way to delete "obsolete" fields from the listing of available fields for a given database, follow this tip.FormulaRlatulippe@romac.com04/19/2000
32 bit free disk space funtion call In Windows to check Freespace on Disk.Returns Freespace on C: DriveLotusScriptRlatulippe@romac.com04/19/2000
unprocessedSearch methodThis example searches all or selected documents for documents created after January 1, 1997 that contain "botany" in the Subject field, and places them in the "Botanist's Delight" folder.JavaRlatulippe@romac.com04/19/2000
Required fieldFormulaRlatulippe@romac.com04/19/2000
Via LotusScript, Insert a Computed Subform Based on Preview Pane Status?It is not possible to accomplish this completely in LotusScript, since LotusScript does not manipulate subforms. You must use of a formula in a computed subfield in addition to a LotusScript in the QueryOpen event of the form.LotusScriptRlatulippe@romac.com04/19/2000
NumErrors propertyThis agent prints the number of the error number in the log message.JavaRlatulippe@romac.com04/19/2000
Use the backend class to manipulate the data exchange between a dialog box and the underlying document.When NotesUIWorkspaceDialogBox brings up a dialog box, the backend class is always there whether or not the underlying document is saved to the disk or not. When you click OK on the dialog box, the Querysave event will not be called, but the Queryclose event is called. For example, you want to do some calculations based on user's input and passed the result to the underlying document or determine which field not to pass. You can use [ noNewFields ] , [ noFieldUpdate ] to accomplish this to a certain degree, but here a way to mix saved and unsaved items. This function performs SomeComplicatedCalculation( ) on the item "Year" and then removes it so it is not passed back to the document. In this example, year is set as a default value on the underlying document and may be changed in the dialog box; however, when the dialog box is saved the original default shouldn't be modified.LotusScriptRlatulippe@romac.com04/19/2000
This button script displays the sum of all OrderTotal fields in a database for one day.Each record in the database has OrderNumber, Date, and OrderTotal fields. The script finds all the documents in the database, then uses a loop and a comparison of dates to limit processing to today's documents. For each document, the script adds the OrderTotal to a dailyTotal variable.LotusScriptRlatulippe@romac.com04/19/2000
Formated NumbersGenerates Formated numbersFormulaRlatulippe@romac.com04/19/2000
Handling a specific errorHandling a specific errorLotusScriptRlatulippe@romac.com04/19/2000
DeflateArray Function will remove all duplicate elements in an alphanumeric array (@Unique)This example will take an array of elements containing duplicate names. The function DeflateArray will remove all duplicate elements and pass back the array as a variant. The array will then be formated into a string variable for display in messagebox.LotusScriptRlatulippe@romac.com04/19/2000
How to Use the LotusScript NotesItem CopyItem MethodHow to Use the LotusScript NotesItem CopyItem MethodLotusScriptRlatulippe@romac.com04/19/2000
Prompting Users To Fill In FieldsYou can use the @ Prompt function to prompt users to enter information into a form. For example, you can use a button to prompt users to enter information about their company bowling team without forcing them to move from field to field. This method is often used to make sure users enter information into required fields without the user worrying that they are missing a field.FormulaRlatulippe@romac.com04/19/2000
DB-LookupTakes value (KEY) and does a lookup. By setting the value of the DBLookup to the tempororary variable LookUp, the value can be checked for errors before attempting to set the field to the value.FormulaRlatulippe@romac.com04/19/2000
Delete Environment variables from the notes.ini file.Delete Environment variables from the notes.ini fileFormulaRlatulippe@romac.com04/19/2000
NotesACL and NotesACLEntry classesThe NotesACL class is used to give you access to a database's access control list (ACL). Once the ACL is accessible, NotesACLEntry can be used to retrieve all of the individual entries in the ACL using it's methods GetFirstEntry and GetNextEntry .LotusScriptRlatulippe@romac.com04/19/2000
How to Hide Attachments from Web ClientsHide V2 style attachments from displaying to web browsers?FormulaRlatulippe@romac.com04/19/2000
How to Get Data from an OLE Object via Notes LotusScript Front-End MethodsHow to Get Data from an OLE Object via Notes LotusScript Front-End MethodsLotusScriptRlatulippe@romac.com04/19/2000
setEnvironmentVar method1. This script sets the value of the $HomeTown environment variable to "Tokyo."JavaRlatulippe@romac.com04/19/2000
Dialogbox calls a Form!This script displays a document in a dialog box using the policy form whenever a user clicks the action button. The first layout region on the policy form is sized to fit in the dialog box.LotusScriptRlatulippe@romac.com04/19/2000
Compact all local databases < 90% utilizedChecks all databases Locally and Compacts those that are less than 90% utilized.LotusScriptRlatulippe@romac.com04/19/2000
LotusScript substitute for @DBLookupEver wanted to do a simple @DBLookup in LotusScript? Here's the code to do itLotusScriptRlatulippe@romac.com04/19/2000
How can you tell if a view is Private?There is no property in the view thtat lets you do this, but you can look at the design note for the view via this function:LotusScriptRlatulippe@romac.com04/19/2000
Derive textual date from date & timeThis database has a DATE field as well as StartTime and EndTime fields. This displays the start time as something like: Tue, Jan 29, 8:00:00 AM, or replaces the time
with a couple of dashes if it wasn't entered yet.
FormulaRlatulippe@romac.com04/19/2000
lotus.notes.International classThis agent examines three international settings and displays a setting's value if it deviates from what the agent considers standard.JavaRlatulippe@romac.com04/19/2000
QueryDocumentDelete Event to prevent deletion of any document that contains response documents.Disallows deletion of any documents that contains a response document.LotusScriptRlatulippe@romac.com04/19/2000
Go to the document without scrolling or getting the next set of documents on the web.
When you have a categorized view on the Web, and the documents are protected with READERS.
Going to the document without scrolling or getting the next set of documents on the web. When you have a categorized view on the Web, and the documents are protected with READERS name security you still see the categorized names of the users even though you can't expand them to see their documents. So if you have a couple of hundred documents they have to scroll through all the categorized names to get to their own name. One way of going directly to their username is using the 'STARTKEY' parameter.FormulaRlatulippe@romac.com04/19/2000
Preventing Orphan ResponsesWhen you delete a main document, its response documents are not automatically deleted They become "orphan response" documents. To prevent users from creating orphan responses, have the database object's Querydocumentdelete event trigger the following script:LotusScriptRlatulippe@romac.com04/19/2000
lotus.notes.Agent class1. This example prints the name of the current agent.JavaRlatulippe@romac.com04/19/2000
UnprocessedDocuments propertyIf this agent runs on selected documents, getUnprocessedDocuments returns the selected documents.JavaRlatulippe@romac.com04/19/2000
Limits a field's entry and removes illegal characters - Sample of Serial # Field Put this in a field's Input Validation formulaFormulaRlatulippe@romac.com04/19/2000
NumActions propertyThis agent prints the number of each action in the action message.JavaRlatulippe@romac.com04/19/2000
Reassign Form AgentDatabase: A support desk application
Purpose: Change form name if user is a supervsior. New form allows edit of assign field.
FormulaRlatulippe@romac.com04/19/2000
Remove methodThis script removes the agent in the current database named "Agent To Run."JavaRlatulippe@romac.com04/19/2000
Add Roles To ACLThis formula uses LotusScript to add roles to the ACL of a database. Event = "Initialize". No other subroutines are used.LotusScriptRlatulippe@romac.com04/19/2000
Name property1. This example prints the name of the current agent.JavaRlatulippe@romac.com04/19/2000
Determining if a Notes View is a View or a Folder using the NotesView property, IsFolder.Determine if the object you are dealing with is an actual view, or a folder. To do this, use the NotesView property, IsFolder . IsFolder returns a value of 1, (True) if the object represents a folder, or 0, (False) if the object represents an actual view.LotusScriptRlatulippe@romac.com04/19/2000
Doclinking Parent to Child A Notes formula for doc-linking a parent to a child in Notes R3/4Doclinking Parent to Child A Notes formula for doc-linking a parent to a child in Notes R3/4LotusScriptRlatulippe@romac.com04/19/2000
Conditional Branching: The IF StatementThe IF statement is used to execute other statements based on one or more conditions. Some of the logic used for an IF statement is demonstrated in the following pseudo-code examples:LotusScriptRlatulippe@romac.com04/19/2000
A WAIT FUNCTION???Yes, you'll need to use script and set up a NotesTimer in the form initialize event, when the timer expires it can check the field in the UIDoc and close the whole lot down if there is nothing there....LotusScriptRlatulippe@romac.com04/19/2000
Using $PaperColor to dynamically change background color of a document.Using $PaperColor to dynamically change background color of a document.FormulaRlatulippe@romac.com04/19/2000
32 bit GetPrivateProfileString funtion call to get Screen Saver and WallpaperReturns Screen Saver and Wallpaper used on Windows system.LotusScriptRlatulippe@romac.com04/19/2000
DbLookups that work on a local database and on the server.Writing DbLookups so they work on a local database and on the server.FormulaRlatulippe@romac.com04/19/2000
Check to see if it is a Leap YearChecks current year to determine if it is a leap year.FormulaRlatulippe@romac.com04/19/2000
Remove methodThis script removes the agent in the current database named "Agent To Delete."JavaRlatulippe@romac.com04/19/2000
Testing for browser typeThe following example tests for the browser type and version.JavaScriptRlatulippe@romac.com04/19/2000
GetAllviews Sub RoutineWhen called GetAllviews will list all the views and folders in the current database, using the Views method of NotesDatabase Class.LotusScriptRlatulippe@romac.com04/19/2000
Daily Dilbert AgentThis agent is hardcoded to the specific URL to retrieve the daily dilbert page that is available and send it to a user. It should be run in the background on the server.LotusScriptRlatulippe@romac.com04/19/2000
Y2K Compliant Date Format CheckerThese two JavaScript functions form a Y2K compliant date format checker. They will handle dates in US format mm/dd/yy or mm/dd/yyyyJavaScriptRlatulippe@romac.com04/19/2000
NotesView method FTSearchUsing the NotesView method FTSearch , documents can be located and added to a document collection.LotusScriptRlatulippe@romac.com04/19/2000
Simple Test for Writing to an ODBC Data Source Using LotusScriptThe following test script will evaluate whether you can write to an ODBC source using
LotusScript.
LotusScriptRlatulippe@romac.com04/19/2000
Reloading Rich TextA common problem encountered by Notes developers is the limitation of the NotesUIDocument Reload() method. When you open a document and make changes to its back-end version, you can call the Reload method to display the updates in the front-end version. Changes to rich text fields, however, won't show up. As a workaround, you can close and reopen the current document automatically. For example, the following form action button script takes the current document, appends text to its Body field, closes it, then reopens it. This example assumes there is a view named "AllByUNID" which contains all the documents in the database sorted by UNID.LotusScriptRlatulippe@romac.com04/19/2000
SrvNameDetermines the name of the user's mail server, if it's on a server or if it's localFormulaRlatulippe@romac.com04/19/2000
Format a date fr displayAnd this formula which shows a date as the format 1995-01-15 - Monday, January 15FormulaRlatulippe@romac.com04/19/2000
CurrentAgent propertyThis example prints the name of the current agent.JavaRlatulippe@romac.com04/19/2000
Searching Notes DatabasesSearching Notes DatabasesLotusScriptRlatulippe@romac.com04/19/2000
Replacement class for AgentContextReplaces lotus.notes.AgentContextJavaRlatulippe@romac.com04/19/2000
What's the date of the Last Thursday in November?Returns the last Thursday of Nov.FormulaRlatulippe@romac.com04/19/2000
How do I remove erased fields that keep appearing in the Add Fields
window?
Remove erased field'sFormulaRlatulippe@romac.com04/19/2000
LogError methodThis agent searches for "Rocks" in the documents in the current database and logs an error message to logerror.log in the current Notes directory if no occurrences are found.JavaRlatulippe@romac.com04/19/2000
Dynamically calculate the subdirectory and file name portion of the URLDynamically calculates the subdirectory and file name portion of the URL using @dbname results and use that calculation in building your URL's instead of the replica id.FormulaRlatulippe@romac.com04/19/2000
Moving an item within a listMoves an Item up or down in a listFormulaRlatulippe@romac.com04/19/2000
Elapsed working daysFormulaRlatulippe@romac.com04/19/2000
NotesUIDocument method, DocumentRetrieves item values through the `back-end' document that corresponds to the currently open uidocument using the NotesUIDocument method, Document .LotusScriptRlatulippe@romac.com04/19/2000
How to Create a New Database and Replicate it via LotusScriptUsing LotusScript, you can create either a local replica of a server-based database or a server replica of a local database.LotusScriptRlatulippe@romac.com04/19/2000
Agent to Lookup and update another databaseWith a scheduled agent, go through database A and match a field on a document with a field from another document in a different database B. If there is a match, update a couple of fields in database B from information on the document from database A.LotusScriptRlatulippe@romac.com04/19/2000
Removing a View from a Database using the NotesView method, Remove.It is possible to remove a view entirely from a database. To accomplish this, use the NotesView method, Remove .LotusScriptRlatulippe@romac.com04/19/2000
Interdatabase Access (@Function Formulas)Technique used to build generic interdatabase access using the formula language. Takes into consideration for local no path.FormulaRlatulippe@romac.com04/19/2000
API Call to Get a filename from the user in Lotuscript?This example illustrates how Lotuscript can be used to call a Win32 API Common File Dialog to get a file. Similiar techniques can be used on other operating systems:LotusScriptRlatulippe@romac.com04/19/2000
LastRun propertyThis example prints the date and time that the agent last ran.JavaRlatulippe@romac.com04/19/2000
API to load Windows browserUses a call to a function in the NNOTESWS.DLLLotusScriptRlatulippe@romac.com04/19/2000
Update the full text index of the current database.This script updates the full text index of the current database if the database has been modified since the time the index was updated.LotusScriptRlatulippe@romac.com04/19/2000
DecimalSep, CurrencyDigits, isCurrencyZero, and ThousandsSep propertiesThis agent displays the decimal international settings: the number of decimal (fraction) digits; the decimal separator (between the whole and fraction parts); the 1000s separator; and whether a zero precedes the decimal point if the number is a fraction (no whole part).JavaRlatulippe@romac.com04/19/2000
Access Win32 registry keys in LotusScript?Access Win32 registry keys in LotusScript?LotusScriptRlatulippe@romac.com04/19/2000
Percent Complete in scriptLotusScriptRlatulippe@romac.com04/19/2000
Errors, DebuggingHere are methods you can use to debug code.FormulaRlatulippe@romac.com04/19/2000
Check off "Documents pasted or mailed into database" in the filter dialog box.";
Required Field(s): Categories, From ;

Categorize Incoming Mail If the message is from Barbara Smith, categorize it as Library". If it's from Bob Stark, categorize it as Internal". Otherwise, make it blank".FormulaRlatulippe@romac.com04/19/2000
setEnvironmentVar method2. This script sets the value of the MailServer system environment variable to "Tornado."JavaRlatulippe@romac.com04/19/2000
How can you display the text of individual table cells using LotusScript in Notes R4?How can you display the text of individual table cells using LotusScript in Notes R4?LotusScriptRlatulippe@romac.com04/19/2000
3. Edit ButtonThis formula is the third of a series -- for a set of four buttons: SELECT, ADD, EDIT, and CLEAR. These are simple formulas but they allow you to have a multi-value field showing a list of names (or of any text items) which you can initialize by selecting, add to, edit, or clear. The third button, EDIT, calls up a multivalued list box to edit the field ReaderList.FormulaRlatulippe@romac.com04/19/2000
mci LibLotusScriptdetlef.janssen-seegert@europe.eds.com10/25/1999
unprocessedSearch methodThis example searches all or selected documents for documents created after January 1, 1997 that contain "botany" in the Subject field, and places them in the "Botanist's Delight" folder.JavaRlatulippe@romac.com04/19/2000
SubmitDocument function that controls the document submit.The submitDocument function includes the input validation function calls to test the field values, as shown below:JavaScriptRlatulippe@romac.com04/19/2000
Generates Sequential Project IDsCreate a view GetNumber with ProjectID filed sorted largest to smallest. It will take last (largest) number and add 1FormulaRlatulippe@romac.com04/19/2000
Changing Field Values From a ButtonWhen trying to change field values through the use of a button, while in read mode, follow this tip. If you set fields in read mode, they actually are set in the field. Therefore, all you have to do is set some dummy temp fields in read mode, and compute the translation formulas for the fields you want to set to look for their twin temp field and get the contents if available.FormulaRlatulippe@romac.com04/19/2000
Document Numbers - UniqueThere are times when, for some reason or another, you need a document to behave as a response but it can't be a response because it's a document in it's own right. When faced with this situation I usually create a serial number for the document with this formula. This formula creates a text value containing the users initials and the current time. It looks something like this: JB11-01-93 01:18:15 AM It's accurate to the second so the chances of two serial numbers being the same are very slim. Inheriting this field allow me to sort by serial number and group related documents together. I believe this has advantages over using @UniqueDocumentID. 1. @UniqueDocumentID is undocumented and cannot be depended on. 2. My serial number uses less memory than @UniqueDocumentID
3. My serial number is meaningful. @UniqueDocumentID is not. Using serial numbers allows you to do other things as well. For instance, the "response" documents can add to the serial number. Not only can you identify a common set of documents but you can calculate how many of a particular type of document exist within the set.
FormulaRlatulippe@romac.com04/19/2000
How do you do @Explode in LotusScript?Breaks a delimited string into its component elements and returns the elements in a string arrayLotusScriptRlatulippe@romac.com04/19/2000
Retrieve the Names of all the Views in a Database using the NotesView property, NameRetrieves the names of all the views in a database, use the NotesView property, Name in conjunction with the NotesDatabase View property and the ForAll statement.LotusScriptRlatulippe@romac.com04/19/2000
Deleting Main Documents and Their ResponsesIf you would like all response documents to be deleted from a database when the main document is marked for deletion, follow this tip:FormulaRlatulippe@romac.com04/19/2000
This button script is useful in a mail message to a group of persons.1. When the recipient clicks the button, the script sends a mail message
indicating "Yes" or "No" for the "RSVP." For testing, the name of the current user is used--in practice, you would use your name.
LotusScriptRlatulippe@romac.com04/19/2000
Array functions - complete set68 functions for sorting, searching, hashing, moving, copying, adding, deleting arraysLotusScripthttp://philippe.lord.md/09/21/2001
Quoted ReplyLotusScriptRlatulippe@romac.com04/19/2000
Avoiding Duplicate EntriesThis formula simply avoids duplicate entries in any database.FormulaRlatulippe@romac.com04/19/2000
IsOnServer propertyThis agent gets names.nsf from the user's mail server if the program is running on a server, and from the local Notes directory otherwise.JavaRlatulippe@romac.com04/19/2000
ServerName property2. This script sets the server name of the current agent to the asterisk (*), indicating that the agent can run on any server.JavaRlatulippe@romac.com04/19/2000
Launch a URL without using InterNotes?Launch a URL without using InterNotes?FormulaRlatulippe@romac.com04/19/2000
IsPrime FunctionGiven a positive integer, determines if that integer is a prime number (A number is considered to be prime if it has no factors other than plus or minus itself and plus or minus one). Returns a Boolean value of True or False.LotusScriptRlatulippe@romac.com04/19/2000
How do you access a specific element of a multi-value field?To extract element 'n' from the field "Choices":FormulaRlatulippe@romac.com04/19/2000
AgentContext classThis example gets the context for the current agent, then gets the agent itself and prints the agent name and comment.JavaRlatulippe@romac.com04/19/2000
LastExitStatus propertyThis example prints the last exit status of the current agent.JavaRlatulippe@romac.com04/19/2000
API Call to Retrive Windows System Directory!Uses the function GeSystemDirectoryA in the Kernel32.DLL to retrive the Windows System directory.LotusScriptRlatulippe@romac.com04/19/2000
JavaScript function for doing search and replace of a character within a stringThe following function takes three parameters -- the string upon which it operates, the character it is searching for, and the character it is replacing that character with. It returns the new string product of this search and replace operation, and works in Navigator 3x and 4x, as well as IE 3x and 4x. This can be useful if, say, you are doing parameter passing to a Query_String field in a domino document via the URL, and need to replace the spaces in the text you are passing in the URL with underscore characters. If you are confined to using JavaScript to ac complish this search and replace operation, then this function will do the trick.JavaScriptRlatulippe@romac.com07/08/2000
Retrieving values from within a fieldThis formula retrieves value from a field and creates a dialog box containing a list, using the Formula One Toolkit function calls. In this case, the button, when pressed, goes into another database, called Name & Address Book, looks up a group document for the group Portfolio Managers, retrives all names in that group, then places them in a dialog box. TYhe user chooses one, which is placed in the other database where this button is. Found in WWCR on the Fund form, button labeled "PortFolio Managers"FormulaRlatulippe@romac.com04/19/2000
Agent to change $Ref to new parent documentTakes a given document ID and makes all selected documents responses to that document.LotusScriptRlatulippe@romac.com04/19/2000
Calling Windows Registery APIs to locates Notes executable pathCalling Windows Registery APIs to retrieve registery values from Lotus ScripLotusScriptRlatulippe@romac.com04/19/2000
Check RichText Field for NULLWhen in Edit mode checks RichText Field for NULL.LotusScriptRlatulippe@romac.com04/19/2000
How to Fill a Reader Field with Multiple Names via LotusScriptUse the AppendToTextList method of the NotesItem field to Fill a Reader Field with Multiple Names via LotusScriptLotusScriptRlatulippe@romac.com04/19/2000
Function to remove excess spaces from a stringRemove all excess spaces from the string sLotusScriptRlatulippe@romac.com04/19/2000
Editing a Document with a ButtonEdit a document with a button, without entering into edit mode first. In order to create a button on a form that will do a complete edit of a document, as well as insert data into a field without first having to go into edit mode and save the document in read mode, follow these procedures:FormulaRlatulippe@romac.com04/19/2000
Retrieve the name of the Default View in a Database using the NotesView property, IsDefaultView. It is possible to retrieve the name of the default view in a database using the NotesView property, IsDefaultView . Since IsDefaultView is a property of each individual view in the database, it is necessary to test each view in a database until the default view is found.LotusScriptRlatulippe@romac.com04/19/2000
Open a Document That Appears in a Hidden View.This macro is designed to open a document that appears in a hidden view:FormulaRlatulippe@romac.com04/19/2000
Rules for Creating LotusScript Agents that Execute from a Web BrowserBelow are a list of items to keep in mind while creating LotusScript agents that will be executed from a web browser.LotusScriptRlatulippe@romac.com04/19/2000
JavaScript function for doing search and replace of a character within a string The following function takes three parameters -- the string upon which it operates, the character it is searching for, and the character it is replacing that character with. It returns the new string product of this search and replace operation, and works in Navigator 3x and 4x, as well as IE 3x and 4x. This can be useful if, say, you are doing parameter passing to a Query_String field in a domino document via the URL, and need to replace the spaces in the text you are passing in the URL with underscore characters. If you are confined to using JavaScript to accomplish this search and replace operation, then this function will do the trick.JavaScriptRlatulippe@romac.com07/08/2000
JavaScript function for failNullThe JavaScript function for failNull follows:JavaScriptRlatulippe@romac.com04/19/2000
Name property2. This example prints the names of all agents in the current databaset.JavaRlatulippe@romac.com04/19/2000
Interdatabase Access (LotusScript)Sets up connectivity amoung an application suite set in same path.LotusScriptRlatulippe@romac.com04/19/2000
Checking Validity of Pasted DocumentsThe following script checks to make sure the pasted document uses the correct form and passes all the form's validation formulas. If not, the document is deleted. Use this script with a view's Postpaste event.LotusScriptRlatulippe@romac.com04/19/2000
How to Have a Script in Notes R4 Pause for Some Time and then ContinueBelow are two examples illustrating how to have a script pause for a specified amount of time and
then continue.
LotusScriptRlatulippe@romac.com04/19/2000
STRING TOKENIZINGSTRING TOKENIZING. A very common programming problem is one where you have a string of characters, that you'd like to split into individual chunks (or tokens). Typically, white space (created by inserting spaces and tabs) is used to separate one token from the next. The Java language provides an easy way to solve this problem: the java.util.StringTokenizer class. You create a new instance of StringTokenizer, specifying a string to be tokenized. Then hasMoreTokens and nextToken are called repeatedly to obtain the next token from the string.JavaRlatulippe@romac.com04/19/2000
Quarter Column CalculationQuarter Column Calculation FormulaFormulaRlatulippe@romac.com04/19/2000
Memory leak checking for LotusScriptCode that you can place at beginning and end of an agent to see if it is leaking memoryLotusScriptjohn@dalsgaard-data.dk10/20/1999
Approve Workflow ButtonThis formula is a short illustration of a very powerful technique. Suppose you have several routing steps in a workflow application. Each step may have very similar fields and buttons, but of course Notes formulas do not have subroutines to generalize functionality. Here we get our specific stuff out of the way at the top, and have generic code the rest of the way. Thus when you change the way the formula works, you don't have to copy the code, and then go through the painstaking and error-prone process of adapting essentially the same formula to the different sections of code. This sample is based on the approach that there are a number of sets of fields, each essentially the same, where each fieldname ends in an ordinal number, 1, 2, 3, etc., corresponding to the position of the set.FormulaRlatulippe@romac.com04/19/2000
Perform a full text search on the current database. It sends the user a newsletter with linksThis action script allows the user to perform a full text search on the current database. It sends the user a newsletter with links to the top ten documents found in the search.LotusScriptRlatulippe@romac.com04/19/2000
Function String ExplodeThis function takes a string and converts it to an array, based on a delimiterLotusScriptRlatulippe@romac.com04/19/2000
LotusScript Classes - ExamplesDemonstrates how to create and use a class called DisplayMsgLotusScriptRlatulippe@romac.com04/19/2000
Creating an Edit History 1-99 editsThis formula compiles a list of edits that can be adjusted from 1-99 edits. This formula is from the Advanced App Dev courseware in the Appendix "Tips and Tricks" page 189. Create a computed, text field called "SaveHistory".FormulaRlatulippe@romac.com04/19/2000
2. Add ButtonThis formula is the second of a series -- for a set of four buttons: SELECT, ADD, EDIT, and CLEAR. These are simple formulas but they allow you to have a multi-value field showing a list of names (or of any text items) which you can initialize by selecting, add to, edit, or clear. The second button, ADD, adds names to a field called ReaderList. For simplicity, we are using an R4 N&A picklist, but you could also use @DbLookup, or an @PickList view lookup.FormulaRlatulippe@romac.com04/19/2000
CurrentDatabase propertyThis example prints the title of the current database.JavaRlatulippe@romac.com04/19/2000
lotus.notes.Newsletter class1. This agent performs a full text search on the current database and creates a newsletter. The agent formats a newsletter message containing a link to each matching document and sends it to the current user.JavaRlatulippe@romac.com04/19/2000
Calculating Window TitlesThis example will display New Patient in the window title for new documents, patient (Owner) for existing documents, and patient (Unknown Owner) for existing documents whose owner is unknown. This example is contrived to illustrate a technique, but is useful in understanding how to calculate window titles.FormulaRlatulippe@romac.com04/19/2000
Checking for Pre-Existing DocumentsFormulaRlatulippe@romac.com04/19/2000
Sort - Bubble Sort AlgorithmSorts an array of data using the Bubble Sort AlgorithmLotusScriptRlatulippe@romac.com04/19/2000
Can you have views based on the current user name?Can you have views based on the current user name?FormulaRlatulippe@romac.com04/19/2000
Script changes the an item on each document selected in a viewThis view action script changes the Status item on each document selected in a view. If someone else edits one of the documents at the same time, the document is not saved. Instead, a response document that contains the change to the Status item is created and saved.LotusScriptRlatulippe@romac.com04/19/2000
Who can edit a field is determined by reading a group of users from view and comparing them to the current userUpon entering a field, a view is read to determine if the person can edit that field. The view that is read is created from a form that has the key eEngine value and the persons in the aTest_Eng (test engineers) field.LotusScriptRlatulippe@romac.com04/19/2000
Evaluate to determine a users role.Use evaluate to determine users role and only then execute block of code.LotusScriptRlatulippe@romac.com04/19/2000
API Call to reference functions in Dynamic Link Libraries ?Calls a C function exported from Windows DLL to get WinDirLotusScriptRlatulippe@romac.com04/19/2000
Ensuring that your applications are independent of a particular Domino server.If you want your applications to be independent of a particular Domino server or directory structure, don't hard-code any URLs. Instead, use this formula when you need the path and database name. You can then follow with "view/document" or "form?openform" etc.FormulaRlatulippe@romac.com04/19/2000
Hide Navigator When Opening A ViewUse this formula to open a view from a navigator hotspot or button when you want to hide the navigator pane in the view. For example, this formula tells Notes to open a view called Texas, then expand the all categories within the opened view, then hide the navigator that would typically be displayed on the left of the window. Use this type of formula when you either want to hide the navigator so that the user can't select options from it, or to provide more space on-screen for the view contents.FormulaRlatulippe@romac.com04/19/2000
IsEnabled property1. This script prints the status for each agent in the current database: enabled or disabled.JavaRlatulippe@romac.com04/19/2000
Create a new class to display objectsA very simple example might be to create a class to display a message. We’ll do this in LotusScript by creating a class called DisplayMsg. In the following listing, the DisplayMsg class is shown, where you will see a property called Text and a method called Display.LotusScriptRlatulippe@romac.com04/19/2000
Error handling using IsOpenError handling using IsOpenLotusScriptRlatulippe@romac.com04/19/2000
Approved & Mail buttonFormulaRlatulippe@romac.com04/19/2000
Import a Text File into a Rich Text Item via LotusScriptImports a text file (c:\temp\sample.txt) into a rich text Item named
"Body".
LotusScriptRlatulippe@romac.com04/19/2000
Showing different Subforms on the WebSometimes a document might be to big or to confusing to fill out as one document on the web. One way to break up this document is to create multiple subforms, and on the submit of the form change the subform and reload the page. This method will involve a computed subform, the webquerysave or $$ querysaveagent event, and a field called ChangeSubForm. The Agent will assume that is the ChangeSubForm field equals SubForm2 then the document is finished and it should be submitted.LotusScriptRlatulippe@romac.com04/19/2000
Open a document in edit mode if it exists.Open a document in edit mode if it exists.LotusScriptRlatulippe@romac.com04/19/2000
Count the number of documents in a viewCounts documents in the view "By Author" in the learning.nsf database.LotusScriptRlatulippe@romac.com04/19/2000
Error handling with On ErrorError handling with On ErrorLotusScriptRlatulippe@romac.com04/19/2000
Web Counter using Profile Document@function interfaces so that you can avoid using up the agent process. A computed-for-display field with the following formula will act as a counter for notes and web access with a timestamp and keeping the counter by document id fields within a single profile document:FormulaRlatulippe@romac.com04/19/2000
70
Show details for (Not Categorized)(Not Categorized)
934