Manage Learn to apply best practices and optimize your operations.

LotusScript creates drag and drop interface in Lotus Notes client

Using this LotusScript, you can create a drag and drop interface that you can implement in your users' Lotus Notes clients, allowing them to move documents from one view to another.

I was recently asked to create a user interface in the Lotus Notes client that would allow my users to drag and drop documents from one view (the source) into other views (the destination) in the same window.

In my example, the source view contained Mail Received and the three destination views were: On Hold, In Process and Completed.

After several attempts using the drag and drop events available in the View and DB event handlers, I found that the events don't work between views. This functionality only seems to works with folders. So I came up with a simple solution.

  1. Create a frameset and define the source and destination views. Be sure to assign a suitable name to each frame.
  2. Note: The trick was figuring out which documents were selected in the source view as they are dragged into the destination view.

  3. In the QueryDragDrop event of the destination view, include the following LotusScript code:
    Call ws.SetTargetFrame("SourceFrame") 
    'this is the key
    Set uiview = ws.CurrentView
    Set DocColl = uiview.Documents

    The SetTargetFrame changes the reference to the source view and voila, you get the document collection.

  4. With the collection in hand, write the required code in the PostDragDrop event of the respective target view.

That's all it takes. You now have a cool drag and drop feature that users can play without the worry of action buttons.

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

This tip was submitted to the tip library by member Vijay Sreegiriraju. 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.

Dig Deeper on LotusScript

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...