---
description: >-
  Triggers an events for a control, or the Gebra Suite app itself. Some events
  are on Gebra Suite App level (like e.g. onRecordSaved ). Other events are on
  control level (like e.g. onClick)
---

# triggerEvent

### Parameters

1. eventName (string) - This parameter represents the type of event that you want to trigger. It is expected to be a string&#x20;
2. controlId (string) - This parameter represents the ID of the control or element for which the event is being triggered&#x20;
3. details (any) - This parameter is more generic and can hold additional information or details related to the event

## Example Usages

```javascript
app.triggerEvent("click", "myButton"); //This triggers a button Click for the control "myButton"
app.triggerEvent("recordSaved"); //This triggers the event, that would otherwise occur if a record was saved
```

You can use the whole event name with the "on" prefix as well

```javascript
app.triggerEvent("onClick", "myButton"); //This triggers a button Click for the control "myButton"
app.triggerEvent("onRecordSaved"); //This triggers the event, that would otherwise occur if a record was saved
```

### Return Values

The triggerEvent function can return different values based on the outcome.

* undefined, if no matching event function was found and the event was dispatched.
* a boolean value, true if the event was not prevented, false otherwise
* the result of an executed event function if one was found
