Repository navigation
Description
Please include the following with each issue:
1. Describe the bug
Creating an option type table field with ValuesAllowed set without OptionMembers set throws with System.NullReferenceException.
2. To Reproduce
Open VS Code with AL Extension version 18.1.2842859 or 30.0.2863738. Create a table with an option field which has ValuesAllowed set but OptionMembers not set. Expected result is a message informing the author that OptionMember must be set. If both are set there is no issue. If OptionMember is not set but ValuesAllowed is also not set there will likewise be no issue (correct error message).
A similar issue can be observed when creating a page with the following property set on an action
RunPageLink = "Date Filter" = const(-20240101D);.
Same error message but different call stack in this scenario.
- Go to '...'
Table example:
table 50100 "PTE Some Table"
{
fields
{
field(1; "My Field"; Option)
{
DataClassification = ToBeClassified;
//OptionMembers = "Some Value";
ValuesAllowed = "Some Value";
}
}
}
Page example:
page 50100 "PTE Some Page"
{
SourceTable = Customer;
actions
{
area(Processing)
{
action(A)
{
RunObject = page "Customer Card";
RunPageLink = "Date Filter" = const(-20240101D);
}
}
}
}
Note: The same can be observed even if the field we are using in RunPageLink is not a date type as long as we are using this constant value (-0D also throws, other malformed versions of dates I tried did not.)
3. Expected behavior
To get the errors which I get in with any other values (explaining what the issue is in the code rather than the compiler crashing.)
4. Actual behavior
5. Versions:
- AL Language:
- Visual Studio Code: 18.1.2842859 or 30.0.2863738
- Business Central: Not needed for this example.
- List of Visual Studio Code extensions that you have installed:
- .NET Install Tool & AL Language extension for Microsoft Dynamics 365 Business Central
- Operating System:
- [ W11 Home 25H2 26200 & W11 Enterprise 25H2 26200 (2 laptops) ] Windows
- [ X] Linux
- [ X] MacOS
Final Checklist
Please remember to do the following:
-
[ Checked and didn't see these specific errors.] Search the issue repository to ensure you are reporting a new issue
-
[ .Net Install Tool is a dependency of AL .. all others are uninstalled] Reproduce the issue after disabling all extensions except the AL Language extension
-
[ ✔️] Simplify your code around the issue to better isolate the problem
Activity