# 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);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sharelogic.com/unifi/4.2/troubleshooting/development/copying-an-existing-unifi-trigger-rule-doesnt-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
