# Button: Codeunit execution

Execute proprietary code

### Properties

- Type: [Action button](https://docs.tsnocode.com/books/field-type-reference/chapter/action-button)
- Groupable: No
- Show in lists: No
- Searchable: No

## <span class="mw-headline" id="bkmrk-user-interface-1">User interface</span>

<span class="mw-headline">Field in show mode</span>

[![image.png](https://docs.tsnocode.com/uploads/images/gallery/2025-07/scaled-1680-/5EhHWp8pBWQBS7wE-image.png)](https://docs.tsnocode.com/uploads/images/gallery/2025-07/5EhHWp8pBWQBS7wE-image.png)

Due to its nature this field has no special editing mode.

## <span class="mw-headline" id="bkmrk-configuration-1">Configuration</span>

[![image.png](https://docs.tsnocode.com/uploads/images/gallery/2025-07/scaled-1680-/DVZSXjBTP8C3HG0G-image.png)](https://docs.tsnocode.com/uploads/images/gallery/2025-07/DVZSXjBTP8C3HG0G-image.png)

<span class="mw-headline">\[Description of configs\]</span>

### <span class="mw-headline" id="bkmrk-ajax-subforms-1">Ajax subforms</span>

The following code changes subform behavior to call the codeunit silently and reload the page when done

```javascript
$(function() {
  $('#VB_DATA_SUBFORM a.codeunitButton').click( function(e) { 
    e.preventDefault(); 
    $.get( $(this).attr("href") );
    //$(this).parent().parent().hide();
    location.reload();
    return false; 
  });
});
```

## <span class="mw-headline" id="bkmrk-developer-info-1">Developer info</span>

- FeltTypeID: 750
- SQL datatype: N/A
- Class name: FieldCodeunitPage