# Record.TestField(Any) Method
> Version: _Available or changed with runtime version 1.0._
Tests that the content of the field is not zero or blank (empty string).
## Syntax
```al
 Record.TestField(Field: 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.
## Remarks
When `TestField(Field)` fails because the field is blank or zero, the runtime automatically adds a Show [Record] action button to the error dialog. This button navigates the user to the card page of the related record, allowing them to fill in the missing value. This automatic navigation behavior is built into the platform and doesn't require an ../errorinfo/errorinfo-data-type parameter.
### How the platform determines the target page
The runtime resolves the navigation target by finding a Card-type page whose ../../properties/devenv-sourcetable-property matches the table of the record that failed validation. For example, if TestField fails on a Vendor record, the runtime identifies the Vendor Card page (a page with `PageType = Card` and `SourceTable = Vendor`) and uses it as the navigation target.
### Limitations of automatic navigation
The automatic navigation provided by `TestField(Field)` has the following limitations compared to explicit ../errorinfo/errorinfo-data-type-based navigation:
 No field highlighting - The error dialog doesn't highlight or focus the specific field that needs attention. With ErrorInfo, you can set ../errorinfo/errorinfo-fieldno-method to direct the user to the exact field.
 No custom button caption - The button always shows "Show [Record Name]." With ErrorInfo.AddNavigationAction, you can provide a custom caption.
 No custom page choice - The platform always navigates to the default card page for the table. With ErrorInfo, you can specify any page using ../errorinfo/errorinfo-pageno-method.
 No detailed message - There's no additional context beyond the standard field-is-empty error. With ErrorInfo, you can add a ../errorinfo/errorinfo-detailedmessage-method with troubleshooting guidance.
### When to use explicit ErrorInfo instead
Even though `TestField(Field)` provides automatic navigation, consider using the TestField(Field, ErrorInfo)<record-testfield-joker-errorinfo-method> overload with an ErrorInfo object when you need to:
 Highlight the specific field that requires attention
 Provide a custom navigation button caption
 Navigate to a page other than the default card page
 Add a detailed message or title to help the user understand the fix
 Add a Fix-it action that programmatically resolves the error
This behavior only applies to the single-parameter overload. The two-parameter overload TestField(Field, Value)<record-testfield-joker-joker-method> doesn't provide automatic navigation - it displays a plain error message with an OK button only. To add custom navigation to a two-parameter TestField call, use the TestField(Field, Value, ErrorInfo)<record-testfield-joker-joker-errorinfo-method> overload with an ErrorInfo object that specifies a page ID.
## 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-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-method/
