# Record.TestField(Any, Any) Method
> Version: _Available or changed with runtime version 1.0._
Tests whether the contents of a field match a given value.
## Syntax
```al
 Record.TestField(Field: Any, Value: Any)
```
## Parameters
Record
Type: record-data-type
An instance of the record-data-type data type.
Field
Type: ../any/any-data-type
The field that you want to test.
Value
Type: ../any/any-data-type
The value that you want to compare to Field. The data type of this parameter must match the data type of Field. If you include this optional parameter and the contents of Field do not match, then an error message is displayed. If you omit this parameter and the contents of Field is zero or blank (empty string), then an error message is displayed.
## Remarks
Unlike the single-parameter TestField(Field)<record-testfield-joker-method> overload, this two-parameter overload doesn't automatically add a Show [Record] navigation button to the error dialog. When `TestField(Field, Value)` fails, it displays a plain error message (for example, "Status must be equal to 'Certified' in Routing Header...") with only an OK button.
This behavioral difference is by design: the single-parameter overload checks for a non-empty/non-zero value, and the platform knows the fix is "go fill in the field on the record." The two-parameter overload checks for a specific value, and the platform can't assume which page or action would resolve the mismatch.
If you want the error dialog to include navigation to a related record, use the TestField(Field, Value, ErrorInfo)<record-testfield-joker-joker-errorinfo-method> overload and configure the ../errorinfo/errorinfo-data-type object with the appropriate ../errorinfo/errorinfo-pageno-method and ../errorinfo/errorinfo-recordid-method. You can also add a ../errorinfo/errorinfo-fieldno-method to highlight the specific field that needs correction.
## Related information
record-data-type
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/record/record-testfield-joker-joker-method, 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/record/record-testfield-joker-joker-method/
