# Raising global events

**URL:** <https://forums.fusetools.com/t/raising-global-events/5815>\
**Category:** How-to Discussions\
**Created:** [June 21, 2017, 7:59am UTC](https://forums.fusetools.com/t/raising-global-events/5815 "2017-06-21T07:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Palton](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Palton](https://forums.fusetools.com/u/Palton)\
**Post date:** [June 21, 2017, 7:59am UTC](https://forums.fusetools.com/t/raising-global-events/5815/1 "2017-06-21T07:59:40Z")

</div>

Hi!

I’m trying to create a global error event handler that shows a modal with the error message, but I’m currently having difficulties when setting up the event.

Just below the `<App>` tag I have declared `<UserEvent ux:Name="globalErrorEvent" />` along with `<OnUserEvent EventName="globalErrorEvent" Handler="{handleGlobalErrorEvent}"/>`

Then somewhere dark and cozy I execute the handler `raiseGlobalErrorEvent : function(){ globalErrorEvent.raise() }` and get the following log output:

````auto
JS stack trace: ReferenceError: globalErrorEvent is not defined
    at raiseGlobalErrorEvent (Cards/InputCards/User.ux:189:49)
 in Fuse.Reactive.FunctionMirror<Cards/InputCards/User.ux:189>```

It currently works if I, instead of using javascript, use the markup like this
```<Clicked>
      <RaiseUserEvent EventName="globalErrorEvent" />
</Clicked>```

Any suggestions on how I can trigger this directly from javascript?
````

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [June 22, 2017, 11:53am UTC](https://forums.fusetools.com/t/raising-global-events/5815/2 "2017-06-22T11:53:01Z")

</div>

Hi Palton,

to achieve this you’ll need to use an approach that is shown in [this example](https://github.com/fusetools/fuse-samples/tree/master/Samples/UserEvents).
