# CodeCop Warning AA0224
The count of option captions specified in the OptionCaption property is wrong.
## Description
The count of option captions specified in the OptionCaption property is wrong.
## Remarks
The number of option captions specified in the OptionCaption property must match the number of option values available for a variable or a field on a page or report.
## Example
The following code sample will raise a warning because the number of option values available for the page field `"VAT Posting"` is two, while only one option caption is defined in the OptionCaption property.
```al
page 50100 MyPage
{
    layout
    {
        area(Content)
        {
            field("VAT Posting"; postingOptions)
            {
                OptionCaption = 'Automatic VAT Entry';
            }
        }
    }

    var
        postingOptions: Option "Automatic VAT Entry" , "Manual VAT Entry";
}
```
## Related information
CodeCop Analyzer<codecop>
../properties/devenv-optioncaption-property
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/analyzers/codecop-aa0224, 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/analyzers/codecop-aa0224/
