Keith777a
Novice

Getting a Button to Automatically Click

Jump to solution

Hi All, I have a hidden but enabled button on a form that I'd prefer to control programatically.

 

I have a View that the client enters some data in when the last field is selected is sets a value on a check box to True on the main form (this works fine)

as the 'run another rule' rule doesn't work for a button on a form from the view level. I have added the checkbox so that I can use it's change event to drive the click.

 

on the Check Box change event I have two rules

 

When Checkbox is Changed

      then execute 'button' control's Focus method (configure)

      then execute the When 'Button' is Clicked Rule

 

However this only works if I have a 'message rule' prior to the focus method.

 

I have tried to run the initized form rule thinking it may be something to do with the forms focus.

But that didn't work either.

 

If I make the Button Visible I can click it and everything works as it should. However preferably I'd rather the client not see the button

and just do the click when I programically request it.

 

Does anyone have a solution to this perplexing issue.

 

 

0 Kudos
Reply
3 Replies
ssnathan_72yaho
Apprentice

Re: Getting a Button to Automatically Click

Jump to solution

Hi,

 

Can you not transfer the click event logic run under the Checkbox change event instead of trying to fire the button click event.

0 Kudos
Reply
Andrew_Blinco
Apprentice

Re: Getting a Button to Automatically Click

Jump to solution

Hi Keith

 

Maybe think about moving the View rules to the Form level, then it should be a simple matter of calling the button click event when the check box change event fires.

0 Kudos
Reply
Keith777a
Novice

Re: Getting a Button to Automatically Click

Jump to solution

Thanks All, moving the checkbox to the form and using it's change event from the View, works.

in the Checkbox I have the 'Run Another Rule' which then fires off the Button Click event.

 

This is a great trick when yo have some Rules that you would like to use over and over a bit like a procedure or function and then hide the button from the view of the user.

 

Regards

Keith

0 Kudos
Reply