Stopping Copy and Paste, in Lotus Notes

( Time)

It is very useful for many kinds of Lotus Notes applications (like work flows), to stop users from being able to copy and paste a document into a database application. In R5 a new kind of Agent was introduced, trigger on the Run option ” “If Documents Have Been Pasted”.

from there it’s a little formalu language :

1
2
3
SELECT @All;
@DeleteDocument;
@Prompt([OK];"No pasting Allowed";"Pasting documents into this database is not allowed. Action is cancelled.")

If you what to selectivity allow some documents to be pasted in add a line before the @DeleteDocument

1
2
3
4
SELECT @All;
@if(Form="requestForm";@return("");"");
@DeleteDocument;
@Prompt([OK];"No pasting Allowed";"Pasting documents into this database is not allowed. Action is cancelled.")

Either way you can save your self from getting all kinds of junk documents in your database and views.

This entry was posted in Lotus Domino, Show-n-Tell+Thursday. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted March 24, 2006 at 11:29 am | Permalink

    You can also make use of the QueryPaste event in the views with something as simple as

    Sub Querypaste(Source As Notesuiview, Continue As Variant)
    continue = False
    End Sub

    adding a messagebox if you want. That way, if desired, you can limit pasting to specific views (such as an administrators only view for admins who are allowed to paste documents).

  2. Posted March 24, 2006 at 11:59 am | Permalink

    Good Point Christopher, esp for Admin/Dev only views and docs, because I’m always doing that sort of thing to short cut the work involved! And its worth remembering those view level events.

    However, doing so for each view is such a pain, Although less so if you have planed things upfront and create all your ongoing views off a well built “template” view, but than that rarely seems to happen (to me).

    So, for me, having one place to control this action at the Database level is the way to go, and since there is no Database script QueryPaste event, using the Agent was the ticket.

    It occurs to me adding a line before the @DeleteDocument; like :

    @If (@Contains(@UserRoles;”UberDev” );@Return(”");”");

    would allow those in the UberDev role to bypass the “Stopping Copy and Paste” agent.

    Whether that is a good idea is another question.

  3. Natesh
    Posted April 17, 2006 at 2:50 am | Permalink

    Formula above prompts multiple times when more than 1 document is pasted. To avoid this, the code in the agent can be changed to Lotus script

    Dim sess As New notessession
    Dim db As notesdatabase
    Set db = sess.CurrentDatabase
    Msgbox “Pasting documents into this database is not allowed. Action is cancelled.”
    Call db.UnprocessedDocuments.RemoveAll(True)

    Ian : Good point and nice fix!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
  • Follow

  • Archives (since 2003)

  • Categories

  • Recent Posts

  • Twitter Updates

    • I liked a YouTube video -- Recycle your unwanted electronics - City of Toronto http://youtu.be/91OXkMkesBc?a 13 hours ago
    • I'm organizing and coordinating my Japan Trip with Google Wave. Seeing both the promise and the fail. of the product. 18 hours ago
    • I have failed my saving Throw against Shiny ... I new 32G iPod Touch is on order :) 1 day ago
  • del.icio.us links

  • Flickr

    Hanging Gardens of KensingtonHanging Gardens of KensingtonMore Chocolate CakeMore Chocolate Cake
  •  

    March 2006
    M T W T F S S
    « Feb   Apr »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Spam Blocked