# TestField data type
> Version: _Available or changed with runtime version 1.0._
Represents a testable field on a page.
## Instance methods
The following methods are available on instances of the TestField data type.
Method name|Description
testfield-activate-method|Activates a field on a test page.
testfield-asboolean-method|Converts the value in a field on a test page to a Boolean data type.
testfield-asdate-method|Converts the value in a field on a test page to a Date data type.
testfield-asdatetime-method|Converts the value in a field on a test page to a DateTime data type.
testfield-asdecimal-method|Converts the value in a field on a test page to a Date data type.
testfield-asinteger-method|Converts the value of the field on a test page to an Integer data type.
AssertEquals(Any)<testfield-assertequals-method>|Asserts that the value in a field on a test page equals a specified value.
testfield-assistedit-method|Provides assist-edit functionality to a field on a test page.
testfield-astime-method|Converts the value in a field on a test page to a Time data type.
testfield-caption-method|Gets the current caption of the field as a String.
testfield-drilldown-method|Applies drill-down capability for a field on a test page.
testfield-editable-method|Gets the editable state for the field.
testfield-enabled-method|Gets the enabled state for the field.
GetOption([Integer])<testfield-getoption-method>|Gets the options for a field on a test page.
GetValidationError([Integer])<testfield-getvalidationerror-method>|Gets the validation error that occurred on a test page.
testfield-hidevalue-method|Gets the hide value state for the field.
testfield-invoke-method|Invokes the default action on the field.
testfield-lookup--method|Provides a lookup window for a text box on a test page.
testfield-lookup-recordref-method|Calls the OnAfterLook trigger with the selected record
testfield-optioncount-method|Gets the number of options in a field on a test page.
SetValue(Any)<testfield-setvalue-method>|Sets a value for a field on a test page.
testfield-showmandatory-method|Gets the ShowMandatory state for the field.
testfield-validationerrorcount-method|Gets the number of validation errors that occurred on the test page.
Value([Text])<testfield-value-method>|Gets or sets the value of this field.
testfield-visible-method|Gets the visible state for the field.
## Related information
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/testfield/testfield-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/testfield/testfield-data-type/
