# Populating CallType

### Locating the Call Type ID in ActiveH

The **Call Type** field in ActiveH CRM can be updated upon submission of a script.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FqqtvRbgQFtlcIVVzEb16%2FCall%20Type%204.4.7.png?alt=media&#x26;token=f8f6ce90-087a-407b-ab6e-b958778514bb" alt=""><figcaption><p>ActiveH Call Type</p></figcaption></figure>

Before updating Keyfax, we must know the Call Type ID within ActiveH.&#x20;

Select "Codes Maintenance" from the "Tools" menu.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FYGfT0Lxyvm2OB7S3QqSC%2FActiveH%20Codes%20Maintenance.png?alt=media&#x26;token=c40757d5-b319-403a-8b9f-bced88609b12" alt=""><figcaption><p>Codes Maintenance</p></figcaption></figure>

Search on the text "Call Type".

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FFLJZioExIYzTK0CKBBL2%2FActiveH%20Codes%20Maintenance%20Selection.png?alt=media&#x26;token=1abf180c-4a4f-4c05-aeed-500738848aa5" alt=""><figcaption><p>Call Type selection</p></figcaption></figure>

Double click on "Call Type / Category" and search for the Call Type you wish to return.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FfQTMBNP07vfu1CD2o69q%2FActiveH%20Repairs%20Request%20Call%20Type.png?alt=media&#x26;token=48bcd7d1-bbda-4901-bb76-e92d16fcc88f" alt=""><figcaption><p>Repairs Request Call Type</p></figcaption></figure>

Double click the Call Type and note down the ID as highlighted (301 - in this example).&#x20;

Note: ID's may be different across different ActiveH environments.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FJ0HVW8TTnrJ8oRp0tEtF%2FActiveH%20Call%20Type%20ID.png?alt=media&#x26;token=4f4f2c1b-9749-4e26-8121-15bfb997fa79" alt=""><figcaption><p>Call Type ID</p></figcaption></figure>

### CallType - Company Data Databox

Within the entity, Databoxes; check wither a Databox has already been created listing the details for the CallTypes. If this does not exist; create a [company-data](https://docs.keyfax.biz/product-suite/admin/entities/databoxes/company-data "mention") Databox with the following details:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FQCns4wT4JiswKZx9Iz4q%2FCall%20Type%20Company%20Databox%204.4.7.png?alt=media&#x26;token=a03c733d-ecea-4a4f-9368-095e330669ef" alt=""><figcaption><p>Company Databox</p></figcaption></figure>

* **Group:** This can be named as per your Databox grouping structure. We have named the Group MIS in this example.
* **Name:** We have named this CallTypeID to indentify the purpose of this Databox when used in the script.
* **Values:** Enter the Name and Value of the Call Type (obtained from Codes Maintenance in ActiveH) that you wish to add.

{% hint style="info" %}
**TIP** To add another line to the Databox click the + button on the right. Multuple CallType codes can be added to the same Databox so this will only need creating once.
{% endhint %}

### CallType - Export Databox

Within Entity Databoxes; check whether a Databox has already been created for the CallType. If this does not exist; create a Databox with the following details:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FTYNvVEgeBiSrDwcvOJMp%2Fimage.png?alt=media&#x26;token=d1e165d6-975a-4d90-afa1-983b6afa05c1" alt=""><figcaption></figcaption></figure>

* **Group:** This can be named as per your Databox grouping structure. We have named the Group MIS in this example.
* **Type:** General.
* **Name:** We have named this CallType to identify the purpose of this Databox when used in the script.
* **Description:** This can be used to give a description of the Databox, can be left blank.
* **XPath:** Fault/CallType/text()

{% hint style="info" %}
**NOTE** The XPath is case sensitive. Please also ensure that there are not two Databoxes with the same Xpath as this will cause Keyfax to error upon submission.
{% endhint %}

### Adding the CallType to a script

To add this to a script in order to pass the CallType back to MIS, please follow these instructions.

Within the script that you require the CallType to be passed, select Databox Read from the Item Type drop down list:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FLqz8zMCNVHstjFhjS45B%2Fimage.png?alt=media&#x26;token=24bb8034-d918-48fc-b3f2-4f1307072250" alt=""><figcaption></figcaption></figure>

Navigate to the Company Data Databox created above and expand to show any code lines that have been created.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FGNp5OLCt5pCJLRX0MOn1%2FCall%20Type%20Selection%204.4.7.png?alt=media&#x26;token=fade3ae9-039b-4574-b3f8-3b89b171b959" alt=""><figcaption></figcaption></figure>

Drag this into the script. This will appear in the Script Step column.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FR7286MMWEJ4bl9TjUkQZ%2FCall%20Type%20Script%20Step%204.4.7.png?alt=media&#x26;token=cd9fb59f-749e-4088-ba54-fb5623cb49d7" alt=""><figcaption></figcaption></figure>

Select Databox Write from the Item Type drop down list:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FZICN8yP4Oa6Dge6bm0hi%2Fimage.png?alt=media&#x26;token=0fa15f62-ca97-49a6-88f7-c07730499502" alt=""><figcaption></figcaption></figure>

Navigate to the Export Databox created above

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2F9jek8nLMGvEdwBbK32pW%2Fimage.png?alt=media&#x26;token=07a37cce-8939-4501-a2a5-cd7520954b80" alt=""><figcaption></figcaption></figure>

Drag this into the script. This will appear in the action column

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FxfG1crgjDPT3VJfsw7m5%2FCall%20Type%20Databox%20Write%204.4.7.png?alt=media&#x26;token=03275035-9197-45e9-9538-1a49d7772ba1" alt=""><figcaption></figcaption></figure>

Finally Save the script.&#x20;
