Please include the following with each issue:
1. Describe the bug
The PerTenantExtensionCop is not producing errors if you add a field or enum value outside of your apps extension range.
2. To Reproduce
Steps to reproduce the behavior:
- Used AL:Go to create a new project. Downloaded symbols from Sandbox.
- Used default app.json with an object range of 50100..50149
- Added settings.json inside
.vscode folder that enables the PerTenantExtensionCop
{
"al.enableCodeAnalysis": true,
"al.codeAnalyzers": [
"${PerTenantExtensionCop}"
]
}
- Created a table extension for the Customer table. Added a field with the ID 60000 which is inside the PTE range, but outside the range of IDs for this app.
tableextension 50100 CustomerTableExt extends Customer
{
fields
{
field(60000; "Active"; Boolean)
{
Caption = 'Active';
DataClassification = CustomerContent;
}
}
}
- Build and deploy app to Sandbox. It publishes successfully, even though you have fields outside of your app range.
3. Expected behavior
When adding a field or enum value outside of your app's ID range, I would expect to receive an error (like you do when enabling the AppSourceCop).
Current Work Around - As someone developing a PTE, I wouldn't expect to need to leverage the AppSourceCop (and disable warnings) JUST so I can get effective warnings about developers on our team using fields and enums IDs outside of our app's range.
- Add "${AppSourceCop}" to settings.json
{
"al.enableCodeAnalysis": true,
"al.codeAnalyzers": [
"${PerTenantExtensionCop}",
"${AppSourceCop}"
]
}
- When you build, you are now getting AppSourceCop errors.
The error that is helpful is the following:
error AS0013: The field identifier '60000' is not valid. It must be within the range '[50100..50149]', which is allocated to the application, and outside the range '[50000..99999]', which is allocated to per-tenant customizations.
I would like to see the first part of the error message be displayed when using the PerTenantExtensionCop
4. Actual behavior
A clear and concise description of what happened accompanied by images, animations, or a link to a video showing the issue occurring
This is problematic, as we could have multiple PTEs being installed, which in theory, we are expecting to maintain their own object range. If we do not receive any errors, you do not realize fields are added outside of the app range, and then it's a huge pain to clean up.
5. Versions:
- AL Language: 17.0.2273547
- Visual Studio Code: 1.133.0
- Business Central: US Business Central 28.3 (Platform 28.0.53152.0 + Application 28.3.52162.53387)
- List of Visual Studio Code extensions that you have installed: AL Language Extension
- Operating System:
Final Checklist
Please remember to do the following:
Please include the following with each issue:
1. Describe the bug
The PerTenantExtensionCop is not producing errors if you add a field or enum value outside of your apps extension range.
2. To Reproduce
Steps to reproduce the behavior:
.vscodefolder that enables the PerTenantExtensionCop{ "al.enableCodeAnalysis": true, "al.codeAnalyzers": [ "${PerTenantExtensionCop}" ] }3. Expected behavior
When adding a field or enum value outside of your app's ID range, I would expect to receive an error (like you do when enabling the AppSourceCop).
Current Work Around - As someone developing a PTE, I wouldn't expect to need to leverage the AppSourceCop (and disable warnings) JUST so I can get effective warnings about developers on our team using fields and enums IDs outside of our app's range.
{ "al.enableCodeAnalysis": true, "al.codeAnalyzers": [ "${PerTenantExtensionCop}", "${AppSourceCop}" ] }The error that is helpful is the following:
I would like to see the first part of the error message be displayed when using the PerTenantExtensionCop
4. Actual behavior
A clear and concise description of what happened accompanied by images, animations, or a link to a video showing the issue occurring
This is problematic, as we could have multiple PTEs being installed, which in theory, we are expecting to maintain their own object range. If we do not receive any errors, you do not realize fields are added outside of the app range, and then it's a huge pain to clean up.
5. Versions:
Final Checklist
Please remember to do the following:
Search the issue repository to ensure you are reporting a new issue
Reproduce the issue after disabling all extensions except the AL Language extension
Simplify your code around the issue to better isolate the problem