Events
Totalum events allow you to execute actions when certain conditions are met.
Go to Settings -> Events to view or create new events.
What is an event
In Totalum, events consist of 2 parts: triggers and actions.
Triggers are the conditions that must be met for actions to be executed.
Triggers
Triggers are the ones that trigger the execution of an event, for example, when an item is created, when an item is updated, when an item is deleted, when a webhook arrives.
Types of triggers
onCreate : Executes when an item is created
onUpdate : Executes when an item is updated
onDelete : Executes when an item is deleted
onWebhook : Executes when a webhook arrives
onCrontab : Executes when a crontab arrives
onButtonClick : Executes when a button is clicked
Actions
Actions are the actions that are executed when an event is triggered, for example, sending an http request, creating an item, updating an item, etc.
Types of actions
- executeCustomJavascript : Executes custom code in javascript or typescript
How to view the logs of an API call using totalum sdk
With the following code you can see the logs of an API call using totalum sdk, it is important that you use await for API calls, otherwise the logs will not be saved.
try {
await modules.totalumSdk.crud.createItem("cliente", {nombre: "AAAAAA"})
} catch(err){
console.error(err.response.data)
}