Call Formula Language Using JavaScript in a Web Application

Call Formula Language Using JavaScript in a Web Application

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.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

(i.e don't add any design elements before or after the button). Any manipulation that you do to that subform will cause the "_doClick" routine to change and therefor your new JavaScript button will fail. Then you will have to re-add the subform temporarily to grab the new "_doClick" routine.

USER FEEDBACK TO THIS TIP

  • 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

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.