> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/databox-examples/how-did-it-happen.md).

# How did it happen?

Some clients prefer to ask ‘How did it happen?’ at the beginning of a script: the idea being that if this is a tenant action they may warn of tenant recharges and see if the tenant still wishes to continue and if so to later provide advice as to the estimated cost incurred.

However, when calling multiple scripts this ‘How did it happen’ may appear several times and so the following is designed to address this issue.

### How it works

When a script links to the system script ‘How did it happen?’ it initially checks the Databox HDIH for a ‘1’, if this is there the script Ends, if it is not there then a ‘1’ is put in the HDIH Databox and the script continues. Thus if this link occurs again the 1 is now in the Databox HDIH and the system script will end.

### Databox Creation

Create the following Databoxes:

<figure><img src="/files/rJS4D9CJ3IMx7dPXBfw1" alt=""><figcaption><p>Script databox</p></figcaption></figure>

<figure><img src="/files/FpIWO49f68APKyveDmzS" alt=""><figcaption><p>Company databox</p></figcaption></figure>

Amend the System script ‘How did it happen?’ as shown below\...

<figure><img src="/files/xhhlUtVRSzRjEOlDkR1e" alt=""><figcaption><p>"How did it happen" script logic</p></figcaption></figure>
