LotusScript button saves time searching large Lotus Notes databases

Searching large Lotus Notes databases is time consuming. This LotusScript code can be placed in a button to quickly perform a search of your Lotus Notes database by replacing the view selection criteria per the search query. Use this method to search large databases in seconds.

If you have a Lotus Notes database containing a large amount of data (more than 10 GB), searching for a single word or couple of words can take a great deal of time and may not always produce accurate results. This LotusScript code performs the search activity in your Lotus Notes database and replaces the view selection criteria per the search query. This accurately searches your Lotus Notes database and generates a result in just a...

few seconds.


While working on a project, I came across a Lotus Notes database that had approximately 20 GB of data. One part of the project requirements from the client side was to develop a search functionality with the following criterion:

  1. Work on multiple search criteria
  2. Take as little time as possible
  3. Use a minimal amount of system resources
  4. Be easy to use
  5. Display the correct results

The following elements were used in the test environment:

  • One Lotus Notes database with a large amount of data (20 GB)
  • One search form
  • One frameset to show the view
  • One view to display the search results by changing the view selection formula

There are nine multi-value fields on the search form. Lotus Notes users can select single or multiple search criteria using these fields.

Related resources from SearchDomino.com:
How to clear a Lotus Notes local cache with LotusScript

LotusScript to update and save Lotus Notes profile documents

Display a custom message box using a LotusScript-generated button

Once the search criteria is defined on the search form -- after selecting multi-value fields -- the user clicks on the search button. The LotusScript code shown below is placed in that button. When the button is selected, the code written on its click event will be triggered as follows:
  1. It will declare variables.
  2. It will create a view selection formula based on the selection of multi-value fields.
  3. The code will put the search query into an array, remove null values and put "&" after each search criteria.
  4. Obtain the handle of the view through a back-end object.
  5. Set the view-selection formula according to the newly created view selection formula from the LotusScript code.
  6. Open the same view inside the frameset.

Note: These steps will take some time during your initial database search.

LotusScript to search large Lotus Notes databases
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Niranjan Singh. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

This was first published in December 2008

Dig deeper on LotusScript

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close