AL icon indicating copy to clipboard operation
AL copied to clipboard

Preserve data

Open waldo1001 opened this issue 9 years ago • 14 comments

When I press F5 after a previous build, I notice that I lost all data.

Do I have to foresee an upgrade-codeunit with the global functions as I had to in ExtensionsV1 as well?

waldo1001 avatar Jan 11 '17 14:01 waldo1001

Currently it is not possible to use NavApp functions when developing extensions, but this whole feature is on our radar. No ETA yet.

defr0std avatar Jan 11 '17 15:01 defr0std

well, apparently VSCode recognises it .. image

but you say it doesn't work. So can I conclude there is no way to preserve data at this point?

waldo1001 avatar Jan 11 '17 16:01 waldo1001

Intellisense does recognize it, however you will get a compilation error once you complete the code. "The type or method 'RestoreArchiveData' cannot be used for 'Extension' development.' At this point not all functions are allowed for extension development. We are currently discussing the scope of this feature, I will get back to you on this thread.

defr0std avatar Jan 11 '17 16:01 defr0std

Thanks.

Well, I would appriciate that the scope would be "preserve data" - even in development phase ;-).

waldo1001 avatar Jan 11 '17 16:01 waldo1001

Some progress on this? I can finish the code, it is compiled, but no data restored when I use ` codeunit 70000000 UpgradeData { trigger OnRun(); begin end;

procedure OnNavAppUpgradePerDatabase();
begin

end;
procedure OnNavAppUpgradePerCompany();
begin
    NavApp.RestoreArchiveData(70000000,false);
    NavApp.RestoreArchiveData(70000001,false);
    NavApp.RestoreArchiveData(70000003,false);       
end;

}`

kine avatar Mar 13 '17 09:03 kine

This is still work in progress. We will update this thread once we have a solution proposal

StanislawStempin avatar Mar 14 '17 16:03 StanislawStempin

Apparently, I can add those functions (OnNavAppUpgradePerCompany and OnNavAppUpgradePerDatabase) and apparently they also execute and inside of them I can write into the tables. However, when extension is uninstalled it simply deletes the data, rather than archiving the data.

Has anything changed here?

vjekob avatar Jun 09 '17 14:06 vjekob

@StanislawStempin Will we get a similar feature as in the V1 extensions or will it be completely different?

RasmusTidselbak avatar Jul 05 '17 17:07 RasmusTidselbak

I used some initialization functionality next to the NAVAPP Restore functions in OnNavAppUpgradePerCompany. These don't work as well for now. Anyway I guess it's bad coding to do so at that place.

hvogelpohl avatar Aug 24 '17 12:08 hvogelpohl

@StanislawStempin with NAV 2018 dropping on Friday, is there anything known on this issue?

bwdeleeuw avatar Nov 30 '17 04:11 bwdeleeuw

We are currently working on it.

StanislawStempin avatar Dec 06 '17 10:12 StanislawStempin

@StanislawStempin, do you have any timeline in mind? This becomes very critical for those folks that are planning to use VS Code as their primary dev environment for extensions on NAV2018. All workarounds to restore the data requires time to support that eliminate all efficiency we received with AL.

yandko avatar Dec 22 '17 16:12 yandko

We are actively working on this but I don't think I'm allowed to promise you more than "very soon"

doivosevic avatar Dec 27 '17 11:12 doivosevic

This feature has been implemented and you can read more about it here: https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-retaining-data-after-publishing

doivosevic avatar Feb 14 '18 10:02 doivosevic