Steve C encountered this bug back when you and I were at MLIM (how many years
ago is it now?). I showed him the same solution as the one you describe, as he
insisted on using his own submit.
I prefer a different solution which combines the power of both @Formula buttons
and custom client-side JavaScript. I use an @Formula button which allows me to
do things like
FIELD Action := "Approve";
@Command([FileSave]);
@Command([FileCloseWindow]);
or in a different button
FIELD Action := "Reject";
@Command([FileSave]);
@Command([FileCloseWindow]);
(Where Action is a CFD field so is not saved in the doc but can be accessed by
the WebQuerySave agent)
And I then use a bit of inline JavaScipt to modify the onclick event code
domino has automatically generated for the buttons from
just a call to _doClick(...) to include extra code at the start eg an if
statement with a call to a validation routine. Event code in JavaScript is just
another data object which can be manipulated.
By ensuring you always call the _doClick code you do not get the checkbox
problem.
One day Lotus may let us do this properly by have two events for a button.
Client side custom JavaScript which runs first, then if the custom JavaScript
returns true the automatic domino submit runs, followed by the server-side
@Formula.
Jake,
Steve C encountered this bug back when you and I were at MLIM (how many years ago is it now?). I showed him the same solution as the one you describe, as he insisted on using his own submit.
I prefer a different solution which combines the power of both @Formula buttons and custom client-side JavaScript. I use an @Formula button which allows me to do things like
FIELD Action := "Approve"; @Command([FileSave]); @Command([FileCloseWindow]);
or in a different button
FIELD Action := "Reject"; @Command([FileSave]); @Command([FileCloseWindow]);
(Where Action is a CFD field so is not saved in the doc but can be accessed by the WebQuerySave agent)
And I then use a bit of inline JavaScipt to modify the onclick event code domino has automatically generated for the buttons from just a call to _doClick(...) to include extra code at the start eg an if statement with a call to a validation routine. Event code in JavaScript is just another data object which can be manipulated.
By ensuring you always call the _doClick code you do not get the checkbox problem.
One day Lotus may let us do this properly by have two events for a button. Client side custom JavaScript which runs first, then if the custom JavaScript returns true the automatic domino submit runs, followed by the server-side @Formula.
Jim