File Management Upload File and Excel Buffer methods cannot be used for 'Extension' development.
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?
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.
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!