# Script Invoke Later Advanced Option (Checkbox)

**URL:** <https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [June 12, 2024, 1:41pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742 "2024-06-12T13:41:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [June 12, 2024, 1:41pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/1 "2024-06-12T13:41:01Z")

</div>

In an event script, there's the advanced option for Invoke Later. What does this mean, exactly? When is later?

---

<div class="post-metadata">

**Author:** ![Steven\_Cheron](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Steven\_Cheron](https://forum.inductiveautomation.com/u/Steven_Cheron)\
**Post date:** [June 12, 2024, 1:48pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/2 "2024-06-12T13:48:53Z")

</div>

If you let your mouse hover the "Invoke Later" checkbox you can see informations.

If Invoke Later is checked, the event is called after the event processing is done.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [June 12, 2024, 1:49pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/3 "2024-06-12T13:49:39Z")

</div>

What does that mean though?

---

<div class="post-metadata">

**Author:** ![Steven\_Cheron](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Steven\_Cheron](https://forum.inductiveautomation.com/u/Steven_Cheron)\
**Post date:** [June 12, 2024, 1:56pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/4 "2024-06-12T13:56:46Z")

</div>

I don't know exactly what is the event processing, by default `Invoke Later` is checked, let it unless if your script needs to be execute sooner for some reason.

I never touch this parameters

---

<div class="post-metadata">

**Author:** ![Noah\_Casey](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@Noah\_Casey](https://forum.inductiveautomation.com/u/Noah_Casey)\
**Post date:** [June 12, 2024, 1:59pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/5 "2024-06-12T13:59:30Z")

</div>

When you check the "Invoke Later" checkbox, it means that the script you are setting will be executed after the current event handling is completed, ensuring that the script runs asynchronously and does not block the UI.

The usage scenario would be If you have a script that needs to run in response to a user action (like clicking a button), and this script performs a time-consuming operation, checking "Invoke Later" ensures that the script will run without freezing the interface.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 12, 2024, 2:29pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/6 "2024-06-12T14:29:17Z")

</div>

It is talked about on this page in the manual.

> **[Focus Manipulation | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/vision/scripting-in-vision/focus-manipulation#about-invoke-later)**
>
> Focus Order

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 13, 2024, 5:50pm UTC](https://forum.inductiveautomation.com/t/script-invoke-later-advanced-option-checkbox/91742/7 "2024-06-13T17:50:31Z")

</div>

> [@Noah\_Casey](#):
>
> ensuring that the script runs asynchronously and does not block the UI

This is just wrong.

All event handling in Vision is done on the EDT. If the invokeLater box is checked, your script is invoked at the end of the _current_ (as of that moment) event queue's stack of events (mouse moves, clicks, keyboard events, window movement, etc). If you uncheck invoke later, it is processed _immediately_, before other GUI updating events have had a chance to run.

It has nothing to do with asynchronous processing or moving off the EDT entirely.
