AL icon indicating copy to clipboard operation
AL copied to clipboard

File Management Upload File and Excel Buffer methods cannot be used for 'Extension' development.

Open DavidRoys opened this issue 8 years ago • 2 comments

Issues with AL Language 0.12.15355 NAV 2018 (11.0.19394)

Now that the 2018 version has shipped, I have tried to convert my extension to AL and Extensions v2, but have hit issues where certain methods are not available for 'Extension' development.

I can understand why these are not available, but what are my options? I cannot think of how I can get around this lack of functionality without removing features from my add-on. My problems relate to importing and exporting data from Excel and the actual errors are:

File Management codeunit : The type or method 'UploadFile' cannot be used for 'Extension' development. Excel Buffer table : The type or method 'OpenBook' cannot be used for 'Extension' development. Excel Buffer table : The type or method 'CreateBook' cannot be used for 'Extension' development. Excel Buffer table : The type or method 'GiveUserControl' cannot be used for 'Extension' development.

I can understand how you don't want these methods to be available for the Azure hosted version, but what if I am using Extensions as a means to creating easily upgradable code in an on premises NAV solution? Can I get around this problem by creating my own wrapper for these 'banned' methods?

DavidRoys avatar Dec 11 '17 02:12 DavidRoys

In the desktop version Nav 2018 you can mark your extension as Internal in the app.json ("target": "Internal" ) and then these methods should work. Also please check what is the ExtensionAllowedTargetLevel settings on the server. That should also be Internal.

kalberes avatar Dec 11 '17 10:12 kalberes

Yes that worked perfectly. My server already had the Internal target level set, but as soon as I added the "target": "Internal" line to my app.json file my extension built without errors and worked as expected. Thanks!

DavidRoys avatar Dec 11 '17 20:12 DavidRoys