A previously unknown @Formula reference
It never ceases to amaze me how often I learn something new about a product I have been working with for 12 years. This time it was a little known formula reference called “@UpdateFormulaContext”.
It was just a silly little thing where I have an outline, and instead of giving users a link to open a form and then select the “type” of request on the form, I wanted to give them option in the outline to select the “type” they wanted and I would open the form, prepopulate the “type” field, and refresh the hide-whens. The issue has always been a matter of context; if I opened a form from an outline and then tried to set a field in the new form, the Notes client thought I was trying to set something on the outline, and it would not work.
Enter @UpdateFormulaContext which changes the context of all the code executed after it. So my outline entry code has this:
@Command([Compose];”someFormName”);
@UpdateFormulaContext;
FIELD RequestType := “1″;
@Command([ViewRefreshFields] )
Which opens the “someFormName” form, and sets the RequestType field to one, and does a refresh. Now we can use outline entries like “Do this”, and “Do that”, instead of using the form names when not everybody knows which form is the right form for the job.
Wow, a mere 4 years after R6 comes out and I finally get around to reading the Help file. Imagine what I’ll learn next year!