I'm working on a Lotusscript at the moment which places a menu of actions on the $Inbox (and thereby any folders derived from that design). This action menu has several items with "Hide action if formula is true" selected. The logic behind all of this works perfectly, however I now have the need to re-evaluate these formulas if the user performs certain actions within the folder (eg: if the action is hidden because a certain flag has been set, and that flag is changed I would then like to re-evaluate the formula so the action now appears). I can't seem to find any way to reload a folder or re-evaluate these formulas. Does anyone know of a way to do this?
2 Answers
There is a RefreshHideFormulas method for the NotesUIDocument, but not for a view. You may be able to call the ReloadWindow() method of NotesUIWorkspace, though, so that's worth a try.
As an alternative, triggering an agent that calls the @Command RefreshHideFormulas may also work for you:
Here is some code (borrowed from http://ideajam.net/ideajam/p/ij.nsf/0/3BBA7E25A972ABD88625759600445A50?OpenDocument)
1) Create an @Formula Agent called "RefreshActions", Agent List Trigger with the following code:
@SetTargetFrame("YourFrame");
@UpdateFormulaContext;
@Command([RefreshHideFormulas]);
2) In your Lotusscript, where you want to insert a "refresh frame" call, add this:
Dim agent As NotesAgent
Set agent = db.Getagent("RefreshActions")
Call agent.Run()

- 21,989
- 3
- 55
- 63
-
It looks like it should work, but currently all I'm getting is one of Lotus' terribly helpful error messages: "@Function is not valid in this context". – Adrian Jan 25 '13 at 04:49
-
Make sure that the agent is set as Run Once (@Commands may be used) – Ken Pespisa Jan 25 '13 at 17:11
-
Thanks Ken. I'll give that a try on Monday and let you know. – Adrian Jan 26 '13 at 13:47
-
Okay, so in my version of Domno/Notes (8.5.3) the Run Once option involves setting Target to "None", which is what it was already set to. – Adrian Jan 28 '13 at 22:11
You can use property "Evaluate actions for every document change" found in view properties, [i] tab. Every selection (click, arrows) of document will trigger reevaluating hide whens for actions. Maybe it will work after refreshing view by some action.

- 3,524
- 2
- 23
- 42