WHAT YOU'LL LEARN
  • What exactly can I do?
  • … TBD

Overview
anchor

This extended example demonstrates a more complex event handler for the Entry.

Before Entry Creation
anchor

This example will check the database for entry with same value as a custom field from the new entry being created. If such entry exists, the creation will be prevented by throwing an error.

extensions/cms/entry/eventHandler/create/beforeCreate.ts

Loading Event Handler in Your Project
anchor

The event handler MUST be exported as default export from the file, otherwise it will not work.

To load your new event handler in your project, you need to add it in the root webiny.config.tsx file, like this:

webiny.config.tsx