You Can View User Feedback To This Tip
I've found that inevitably, I need to have Domino process a document with formula language, but I need this to happen after I do something with JavaScript. I use what we call a "Button Engine."
Here's how you do it.
Make sure your form is using "Use JavaScript when generating pages."
Create a button on a subform that has the code you want it to run. This can be any formula language that works on the web.You may want to add some time of description to what this button does. Just be sure that after this step is taken, that you never add anything above or to the left of the button.
Save the subform and then temporarily embed the subform on your form that you want to call the button from.
Preview the form on the web and then view the source. Look for the "_doClick" JavaScript function that goes with the button on your subform. Copy that formula, it may look something like the following:
_doClick('6f2f19449e749333862567b50044d156/$Body/0.78', this, null)
Once you have the above code, remove the embedded subform from your form. You can now use the "_doClick" statement you copied from the source file anywhere you can call JavaScript.
Don't delete your subform with the single button on it from your database and don't change the placement of the button on the subform
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
- The information presented in: Developer Tip: Call formula language using JavaScript in a Web application, is horrible advice! REasterday
This was first published in February 2001