Today I’ve spent few times handling a (not so common I think) scenario where from an extension I need to be able to load a RapidStart package (.rapidstart file) to Dynamics 365 Business Central and apply it.
As explained in my last post, in the cloud environment we need to use Streams for handling files and today I discovered (with pleasure) that Microsoft has modified some methods in codeunit 8620 – Config. Package Import for handling Streams. This permits us to programmatically load a RapidStart package also in the Dynamics 365 Business Central cloud environment and this is the AL code for doing so (in case you need that):
We have two methods available in codeunit 8620 – Config. Package Import:
- ImportAndApplyRapidStartPackageStream: receives a TempBlob record as input and loads and apply the package.
- ImportRapidStartPackageStream: only loads the package passed as TempBlob argument. This function wants also a Config. Setup record (temporary) as input. To apply the package, you need to call the ApplyPackage method defined in Config. Setup table.
I have only a question: I was not able to load multiple .rapidstart packages in a single step! 😦
The solution for this problem could be (alternatively):
- Microsoft will add a new method ImportRapidStartPackageZIPStream that accepts a ZIP file as input containing multiple .rapidstart files.
- Someone gives me a solution 😀