Link between Extensions
We develop different Extensions which have some logical interrelations. E.g. Ext. A and Ext. B both work based on the Item table. When we install Ext. A we can download symbols and then in Ext. B we can add a dependency in the app.json file and then see Ext. A-functions and objects from Ext. B. Then we can make a reference in Ext. B, install this Ext. and now from a page in Ext. B open a page in Ext. A. Works fine.
However, some of our customers will only use and install Ext. B. If we try to do that, we get an error stating that the package Ext. A can not be loaded.
In OnPremise installations we can of course control this by having two versions of Ext. B. One with and one without the link to Ext. A, but in AppSource we can only have one version of each Extension. The link between the two Extensions are logical and very relevant for customers using both Extensions. Please advice.
Hi @naveksa ! The compiler validates that all the dependencies are in place. Dependencies expressed in app.json are hard dependencies and you cannot publish an extension if its dependencies are not met. This is stricter than what was possible in C/AL, but it also prevents a lot of runtime errors. If some of your customers will only have Ext. B installed, and Ext. B opens a page in Ext. A, that means that that functionality will never work if the customer does not have Ext. A installed, right? How do you prevent this runtime error?
This is not related to the development tools, so I suggest you use one of the following resources: Business Central Community mibuso forum Dynamics User Group
In C/AL we had all objects for our add-on's in the database and controlled access by means of the license. I was looking for some equivalent functionality, that is "if there is no access - don't show the link".
I understand. Your current approach will not work because the environment will prevent you from publishing if any of the extension's dependencies are not present in the environment. I think that one option would be to use runtime packages (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-runtime-packages):
- Create extension A and B with the proper dependencies.
- Install both extensions in the customers environment.
- Have a license setup as you've described.
Runtime packages are compiled on your machine against your license. The community might be able to provide you with a better solution. Is it okay if I close this issue? I don't think its scope fits the purpose of the repository.
Closing this issue due to inactivity. I hope that the advice above helped solving your problem. Please create a new Github issue if you are still facing this issue.