microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
744 stars 245 forks source link

Cannot remove DataPerCompany = false from a temporary table #6953

Closed jwikman closed 2 years ago

jwikman commented 2 years ago

Please include the following with each issue:

1. Describe the bug

I'm in the process of upgrading our apps to BC20. We have prepared several tables for a change of TableType Normal to Temporary by setting those to ObsoleteState Pending (in BC18 version of our apps). All those tables also have DataPerCompany = false, since they where only intended to use as temporary we didn't want to clutter the SQL database with empty tables per company.

The bug is that I cannot remove the DataPerCompany property on this table when changing TableType Normal to Temporary. (First reported in https://www.yammer.com/dynamicsnavdev/threads/1369436614213632)

2. To Reproduce Steps to reproduce the behavior:

  1. Create a new app
  2. Enabled code cops:
    1. ${AppSourceCop}
    2. ${CodeCop}
    3. ${UICop}
  3. Add a table with TableType=Normal and DataPerCompany=false
  4. Set the table to ObsoleteState = Pending (and other needed obsolete properties)
  5. Create an app.file, v18.0.0.0 (Pre cooked in ReproDataPerCompany_v18.zip ReproDataPerCompany_v20_fail.zip)
  6. Configure AppSourceCop.json to use the created app file as baseline and copy the app file created above in the .alpackages folder
  7. Now we want to create our BC20 version of this app:
  8. Install AL Language v9.0 (I'm was using AL Language v9.0.582246)
  9. Change set TableType = Temporary
  10. Remove the Obsolete properties
  11. Now I get "error AL0223: The property 'DataPerCompany' can only be set if the property 'TableType' is set to 'Normal'"
  12. Remove the DataPerCompany property
  13. No I get "error AS0039: Property 'DataPerCompany' has been removed, this is a destructive change." (pre cooked in ReproDataPerCompany_v20_fail.zip)

3. Expected behavior I should be able to set TableType = Temporary and remove DataPerCompany from an object that was earlier set as ObsoleteState = Pending, without errors.

4. Actual behavior I get "error AS0039: Property 'DataPerCompany' has been removed, this is a destructive change." 😣

5. Versions:

Final Checklist

Please remember to do the following:

JesperSchulz commented 2 years ago

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 36588 and VS Code Extension Version 9.0.587275.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/

jwikman commented 2 years ago

Thanks for the fast fix @JesperSchulz & @qutreson!

Tested and verified to work on v9.0.587938. 👍