Can I call a shared action via a formula?

Posted on 2009-04-15
Last Modified: 2013-12-18
Currently my lotus script is in querysave. The form has several action buttons that include a filesave, which calls querysave and so executes my code twice (once via the button and again on exiting the doc). This means msgboxes come up twice, etc.

I was thinking about pulling it out of querysave into a shared action or agent. It's a nuisance problem and not worth spending a ton of time on.

My impression is that I can't call a shared action via the formula language, so I have been looking at an agent. Can I just import my script functions into an agent and call it from within the action buttons on the form? Currently all my notes attributes are declared in querysave, will that "port" over to an agent? Or would I have to recode all that?

Question by:BillTr
    1 Comment
    LVL 22

    Accepted Solution

    First a word of warning...

    If you want to ensure that a piece of code is executed when a document is saved, it needs to be placed in QuerySave or PostSave.  In other words, Save actions can be bypassed by using the menu "File \ Save", keyboard (CTRL-S), etc...

    That said, sure, you can normally paste action code directly into the Initialize event of an agent.  Set the agent trigger to "Agent list selection" and the target to "None".  In your code get a handle to the current form using NotesUIWorkspace.CurrentDocument.

    Regarding whether your QuerySave code will port over, it's hard to say.  It normally will, especially if you define the NotesUIWorkspace.CurrentDocument as 'Source'.  Remember, however, that you will loose the ability to prevent a save.  The Continue argument cannot be modified by an agent, only directly in QuerySave.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is an old article, please see an updated version of this article, located here:
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now