Thursday, January 28, 2010

Trigger onclick event of a button in lotus notes client

Ever thought of how to trigger a button onclick event using javascript in Notes Client.... I have been through these night mares when I first learnt javascript and then application development in notes client.

Practically I never crossed this scenario and i wont recommend relying on this as well... unless you are to sure that u have no other go...

The idea behind this experiment is to trigger a formula popup using a javascript coded button in Notes Client. The following are the details of my experiment.

1. Create a form and add two buttons to it namely, "Formula Button" and "Javascript Button".

2.Now in the HTML properties of the button named "Formula Button", give the name as "formulaButton" and put the formula @Prompt(1;"";"Success") in the click event of the formula button

3.Now click the button named "Javascript Button", in the onclick event of the button, choose the Run properties as "Client" and "Javascript" and put in the following code "document.forms[0]"

4.Now save, preview the form in notes client and click the javascript button.
This will bring up a prompt saying "Success". This indicates that the formula popup associated with the Formula Button is triggered by the javascript code in the "Javascript Button" in Notes Client...

Hope this is use ful

No comments:

Post a Comment