> For the complete documentation index, see [llms.txt](https://docs.sharelogic.com/unifi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sharelogic.com/unifi/troubleshooting/development/copying-an-existing-unifi-trigger-rule-doesnt-work.md).

# Copying an existing Unifi trigger rule doesn't work

If you're looking to integrate a new table with Unifi (prior to v3 as this is then done automatically), and you create a new trigger business rule for the new table from an existing Unifi trigger rule, be careful with what you copy! Old business rules use a different way to invoke the script from new ones!

Overwriting a new business rules invoke method with an old one will mean the business rule fails. Only copy the Unifi code inside the business rule invoke method.

Old business rule invoke:

```javascript
function onBefore(current, previous) { 
  .... 
}
```

New business rule invoke method:

```javascript
(function executeRule(current, previous /*null when async*/) { 
  .... 
})(current, previous);
```
