NAV 2018 extensions deletes data when published form VS code.

gnaaktgeboren
Member Posts: 18
Hi,
Every time I publish an extension from visual studio code my data is deleted from the tables that I created earlier.
Anyone else experience the same problem?
Greetings,
Gert-Jan
Every time I publish an extension from visual studio code my data is deleted from the tables that I created earlier.
Anyone else experience the same problem?
Greetings,
Gert-Jan
0
Best Answers
-
it is working from CU2
https://github.com/Microsoft/AL/issues/15916 -
Thanks, I've installed CU2 and that solved the issue.0
Answers
-
which version/build are you using?0
-
I'm using Nav version 11.0.19846.0 and AL language extension version 0.12.15355.0
-
Yes, and this is by design as far as I know. The building of extensions from VS Code are only to be done to development databases, and not to test databases and never ever to live databases.
If you wish to keep the data, you should publish and install the generated extension in a different NAV database using Powershell.
Check these pages:
https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-how-publish-and-install-an-extension-v2
https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-upgrading-extensionsRegards
Peter0 -
did you implement the upgrade logic?
https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-upgrading-extensions0 -
Thanks for the reply.
If it is by design it makes the development process difficult.
For example when you need to debug a new codeunit you first would have to enter all the data in the new tables you have designed over and over again each time you would run the codeunit in debug mode.
That a bit unnecessary if you ask me.
Also upgrade logic isn't the place to make sure the data is saved or is it?
0 -
It's by design. When you hit F5, it re-creates the tables, and the data in the 'old' version is removed. It's the only way to be able to make destructive changes between two dev builds. Annoying when you want to keep some test data, but pretty logical if you think about it.
There's a setting in launch.json called "schemaUpdateMode". When this is set to 'recreate' (the default value) it recreates the table and you lose the data. Set it to 'Synchronize' and you get to keep the data.
You can create some test data by using an Install codeunit (https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-extension-install-code). Don't forget to get rid of the code in your published app, you don't want your test data in there.
1 -
Hi Daniel,
I've tried the schemaUpdateMode but that didn't work.
The message is "Property schemaUpdateMode is not allowed." if I add this to the launch.json.
I've found the link that describes the setting, https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-retaining-data-after-publishing, but it stil doesn't work.
Anyone tried this ?
0 -
isn't this setting only for Dynamics 365 for Finance and Operations, Business edition?
so this is probably only on the devpreview builds of nav0 -
Yeah maybe it's not yet available for the version that you are using, but that is in fact the setting that you need. I don't know of another way to keep the data when you re-build your workspace0
-
I'm using Nav version 11.0.19846.0 and AL language extension version 0.12.15355.
What version are you using?0 -
Is there anyone that has experience with using the schemaUpdateMode property?0
-
it is working from CU2
https://github.com/Microsoft/AL/issues/15916 -
Thanks, I've installed CU2 and that solved the issue.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions