# 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>


---

# 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.keyfax.biz/product-suite/admin/databox-examples/how-did-it-happen.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.
