Search code examples
performancelotus-noteslotus-dominolotusscript

Searching documents and sub documents from two databases in IBM Notes


In IBM Notes I have two databases

Orders.nsf and OrdersArchive.nsf

In the Orders.nsf database I have Orderdocuments and Orderline documents One Order could have X Orderlines.

For example Order 1 has two orderlines:

  1. Cartire
  2. Lamp

So in total there are one Order document and two Orderline documents.

The Orders.nsf database contains all orders from 2014 until now. All older orders + orderlines are in the OrdersArchive.nsf database.

Now there is a view in both database in which people can search for ordelines. So for example John searches for Cartire and sees that there are previous orderlines with cartire.. The problem is that John needs to do the search in the Orders.nsf database and the OrdersArchive.nsf database. Because the order with cartire orderline could be from 2016 but could also be from 2010.

For this I have a new server on which I have a orders.nsf database in which I copied all orders and orderlines from both two database. So that John could search in that database to see if any orderlines or orders already exist..

Problem now is that you have 2 documents. Is there a simpler way to solve this. Like create 1 view on Server 1 which gets all orders an orderlines from the Orders.nsf and the OrdersArchive.nsf database? Or will this reduce performance?


Solution

  • You can't mix two views from different databases into one view in Notes client by default. You can create a search result form that list all entries from both views in an rich text field. But this takes some effort...

    There is an easier way in your case:

    • create a form with SaveOptions="0" that contains both views as embedded views
    • categorize both views by orderline product
    • show only current orderline product in both embedded views
    • add a button "show all" to orderline that creates a document based on that form for current orderline product

    This way, the user sees all entries for a orderline product at once right from an orderline product without the need to switch to and search in two views.