AL icon indicating copy to clipboard operation
AL copied to clipboard

Unsupported field change

Open bachii1010 opened this issue 9 years ago • 8 comments

Hi,

We have created a package and published later we have changed few field names in tables and again created a new package and publishing it but it is giving the below error: image

Please suggest us.

Thanks & Regards Varun Reddy

bachii1010 avatar Sep 18 '17 13:09 bachii1010

Hello,

Are you trying to develop an updated version of the first app? If so, renaming fields is not supported. Schema changes between versions must be backwards compatible from one version to the next.

Can you explain your scenario in a bit more detail so I can see if you are hitting an actual issue?

Thanks, Chris

cmrudolph-msft avatar Sep 18 '17 19:09 cmrudolph-msft

Hi Chris,

We have an initial version of our extensions2.0 app already published. now we have changed few fields names as we have added prefix according to Microsoft guidelines for field names and after that we tried to publish the package in august update again the we are getting the error.

Please let us know if this is what you are looking for.

bachii1010 avatar Sep 19 '17 04:09 bachii1010

Let me dig in with a few specific questions:

  1. What version is the initial version you already have published?
  2. What version is the one you are trying to create & publish now?
  3. What process are you trying to use to publish it (VS Code? PowerShell?)
  4. Do you intend for there to be an upgrade path between the two versions?

We do have a new schema sync process that will make it impossible to rename fields from one version to the next (e.g. 1.0 -> 2.0). This is because some of our new database deployment modes require that schema be backwards compatible to allow multiple versions to coexist in the same tenant database.

cmrudolph-msft avatar Sep 19 '17 12:09 cmrudolph-msft

Hi, Initial Version is 1.0.0.0 New version is 1.0.0.1 We are using VS Code to publish yes we think there should be an upgrade toll or something so that this error will not occur.

Please let me know if any queries.

bachii1010 avatar Sep 19 '17 14:09 bachii1010

Here is the pattern for development:

  1. If you are simply developing something but are not releasing it yet, we recommend not changing the version. The VS Code workflow will publish each package fresh, blowing away any previous schema & data in the process.

  2. Once you have released a version and put it into use, you now need to play by the versioning/compatibility rules for V2 extension sync. At the present time, this means you can only:

  • Add fields
  • Add keys

The error you are getting suggests you are running into this case. Your 1.0.0.0 app is published and synced to the DB. When you try to publish & sync 1.0.0.1, we detect the lack of backwards compatibility and fail the sync. This part is by design.

To state this all differently:

  • If you are still developing the first version of your app (never released), you should stick to the original version. This will let you add/delete/rename things freely until you have finalized your app.
  • If you ARE trying to write an upgrade, then what you are doing with field renames is unsupported. You must maintain field name compatibility with your 1.0.0.0 version.

cmrudolph-msft avatar Sep 19 '17 14:09 cmrudolph-msft

Hi

I'm currently having this same problem when trying to change DataType of field from Code to Integer. There are no references to the field other than it being a primary key and displayed on a page.

As I am still in the process of learning AL with Visual Studio Code this project is just for learning purposes. I have not changed the version after publishing for the first time but still get the following error: image

Any ideas why this is happening?

hermannsson avatar Feb 09 '18 10:02 hermannsson

This probably falls in the same category as the related discussion in https://github.com/Microsoft/AL/issues/1499. To get around this, you need to specify the: "schemaUpdateMode" : "Recreate" in the launch.json file.

defr0std avatar Feb 09 '18 10:02 defr0std

Thanks a lot Dennis! I changed it to "Recreate" and it fixed the problem :)

hermannsson avatar Feb 09 '18 10:02 hermannsson