{"title":"TestField data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/testfield/testfield-data-type/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/testfield/testfield-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Represents a testable field on a page.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Instance methods","slug":"instance-methods","at":99,"chars":2256},{"level":2,"title":"Related information","slug":"related-information","at":2355,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nRepresents a testable field on a page.\n## Instance methods\nThe following methods are available on instances of the TestField data type.\nMethod name|Description\ntestfield-activate-method|Activates a field on a test page.\ntestfield-asboolean-method|Converts the value in a field on a test page to a Boolean data type.\ntestfield-asdate-method|Converts the value in a field on a test page to a Date data type.\ntestfield-asdatetime-method|Converts the value in a field on a test page to a DateTime data type.\ntestfield-asdecimal-method|Converts the value in a field on a test page to a Date data type.\ntestfield-asinteger-method|Converts the value of the field on a test page to an Integer data type.\nAssertEquals(Any)<testfield-assertequals-method>|Asserts that the value in a field on a test page equals a specified value.\ntestfield-assistedit-method|Provides assist-edit functionality to a field on a test page.\ntestfield-astime-method|Converts the value in a field on a test page to a Time data type.\ntestfield-caption-method|Gets the current caption of the field as a String.\ntestfield-drilldown-method|Applies drill-down capability for a field on a test page.\ntestfield-editable-method|Gets the editable state for the field.\ntestfield-enabled-method|Gets the enabled state for the field.\nGetOption([Integer])<testfield-getoption-method>|Gets the options for a field on a test page.\nGetValidationError([Integer])<testfield-getvalidationerror-method>|Gets the validation error that occurred on a test page.\ntestfield-hidevalue-method|Gets the hide value state for the field.\ntestfield-invoke-method|Invokes the default action on the field.\ntestfield-lookup--method|Provides a lookup window for a text box on a test page.\ntestfield-lookup-recordref-method|Calls the OnAfterLook trigger with the selected record\ntestfield-optioncount-method|Gets the number of options in a field on a test page.\nSetValue(Any)<testfield-setvalue-method>|Sets a value for a field on a test page.\ntestfield-showmandatory-method|Gets the ShowMandatory state for the field.\ntestfield-validationerrorcount-method|Gets the number of validation errors that occurred on the test page.\nValue([Text])<testfield-value-method>|Gets or sets the value of this field.\ntestfield-visible-method|Gets the visible state for the field.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}