31
Its a big thing to ask, however i'll try anyway.

We are splitting up our main app and it is easy to end up with a lot of tiny extensions to cover for cross extension functionality. Sort of bridge functionality between our main extensions. So I thought why is it not possible to have a depandancy marked as optional? So we are always developing / compiling with all dependancies, however when deploying for all optional extensions the following should happen:

1. page and table extensions to a non existing optional dependancy should not result in error, just be ignored
2. subscribers that subscribe to a non existing optional dependancy should not result in error, just be ignored.
3. fields that have tablerelations to a non existing optional dependancy should be ignored (or tablerelation removed) or should not be allowed
4. page actions that reference a non existing optional dependancy should be removed
5. codeunits that implements an interface of a non existing optional depencancy should ignore the interface
6. functions with variables that reference objects in a non existing optional depandancy should not be executed, however can be savely called from within the app. Function should do nothing.
7. probably I will be overlooking 2 or 3 things I realize that :)

"dependencies": [
{
"id": "My App ID",
"name": "My App",
"publisher": "My Company",
"version": "0.1.0.0",
"optional" : true
},

>> subscriber function to a publisher in an optional extension should be ignored
[EventSubscriber(ObjectType::Table, 1234, 'OnDiscoverSubscribers', '', false, false)]
local procedure OnDiscoverSubscribers(var IAmAnTableInAnOptionalExtension: Record OptionalExtensionTable)
begin
OptionalExtensionTable.AddSubscriber("ItsMe!", '');
end;

>> every function that has a variable to an object in an optional extension should compile, however code inside is not executed.
local procedure LogError(ErrorText : Text)
var
IAmAnTableInAnOptionalExtension: Record OptionalExtensionTable;
begin
IAmAnTableInAnOptionalExtension.LogError(ErrorText);
end;
Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.

Best regards,
Business Central Team