# Is there a way to force event to fire?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951>\
**Category:** Ignition\
**Created:** [July 31, 2013, 12:56am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951 "2013-07-31T00:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bob/32/16899_2.png) [@Bob](https://forum.inductiveautomation.com/u/Bob)\
**Post date:** [July 31, 2013, 12:56am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951/1 "2013-07-31T00:56:38Z")

</div>

Is there a way to force an event to fire such as the mouseClicked or mousePressed event of a button?

---

<div class="post-metadata">

**Author:** ![RRRancher](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@RRRancher](https://forum.inductiveautomation.com/u/RRRancher)\
**Post date:** [July 31, 2013, 5:42am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951/2 "2013-07-31T05:42:57Z")

</div>

Bob, how about writing a custom script that could be called from the event script when it triggers? Then you could also call that custom script to do the same thing whenever you want.

There may also be a way to force an event to trigger in Ignition. I know it can be done in some other programming languages, but I’m not sure it can be done here.

---

<div class="post-metadata">

**Author:** ![markdobtech](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@markdobtech](https://forum.inductiveautomation.com/u/markdobtech)\
**Post date:** [July 31, 2013, 12:21pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951/3 "2013-07-31T12:21:26Z")

</div>

use “doClick()”

#i.e. force a click on a save button in a property change event  
doButton = event.source.parent.getComponent(‘BuSave’)  
doButton.doClick()

---

<div class="post-metadata">

**Author:** ![Bob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bob/32/16899_2.png) [@Bob](https://forum.inductiveautomation.com/u/Bob)\
**Post date:** [July 31, 2013, 1:31pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-force-event-to-fire/6951/4 "2013-07-31T13:31:27Z")

</div>

The doClick() works nicely, though I did have to move the code from the mouseClicked event to the actionPerformed event which was unexpected.

Doing a custom script could also work.

Thanks for your replies.
