Re: Custom validation on button click VBTools
One quick clarification of terminology to avoid confusion - VBTools (SL SDK in v7) is used for creating new SL application screens using visual basic 6 (Solomon v6.5 and before) or VB.net (SL v7). Customization manager / VBA is used for modifying existing screens at run-time without recompiling them. VBA runs as a layer on top of an existing screen.
I don't believe that it is possible to override the base screen's events in VBA. Even if it were, it would not be advisable because it could interfere with the standard processing logic and have bad side effects.
In order to accomplish what you want, the typical pattern that SL customizers follow is to add a new button to the screen and set the existing cBegProcessing button's 'visible' property to false. Then make the new button have the same caption as the old, and move it to where the old one was.
Then, you can put whatever logic you desire in the button. Once you have finshed your custom validation code, you can click the hidden original button to start processing by setting its value to true, e.g.:
serr1 =
SetObjectValue("cBegProcessing", "True")
It is important that the button still be on the form because some other applications such as object model or application server may be launching the screen and automating it, expecting the button to be there and enabled.
From the user's standpoint, they won't see any difference in the screen as long as you make the caption, button location, style, etc. the same for your replacement button.
Regards,
Paul