# Javascript: ApplicationField.getTypeName Method

> Gets the field's type name. The type name of a Microsoft Word MergeField is MERGEFIELD, for example. If the type name of the field is changed, its parameters must also be changed.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: ApplicationField.getTypeName Method
- **480 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/gettypename-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/gettypename-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/gettypename-method/llms-full.txt

---

### Description

Gets the field's type name. The type name of a Microsoft Word MergeField is MERGEFIELD, for example. If the type name of the field is changed, its parameters must also be changed.

### Syntax

```javascript
<void> ApplicationField.getTypeName(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the field's type name. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ApplicationField.getTypeName` in a practical document-editing workflow. It gets the field's type name. The type name of a Microsoft Word MergeField is MERGEFIELD, for example. If the type name of the field is changed, its parameters must also be changed.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        applicationField.getTypeName(
            function(result) {
                console.log("get type name result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: ApplicationField.getParameters Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/getparameters-method/llms-full.txt)
- **Next:** [Javascript: ApplicationField.setFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/setformat-method/llms-full.txt)
