Integrate with Assisted Setup in your extension

Completed

The assisted setup configuration is stored in the Assisted Setup table, which is table 1803. You don't have to redesign or extend the table, but you'll need to add some information in the table by using the Add function in the Assisted Setup codeunit (3725). This codeunit is part of the System Application and can be found in the ALAppExtensions repository in GitHub.

The Add function is overloaded, which means that you can call this function with a different number of parameters. The main difference is that you optionally can provide a link to a video that will give the user more information about your wizard.

procedure Add(ExtensionID: Guid; PageID: Integer, AssistantName: Text, GroupName: Enum "Assisted Setup Group");

In the Add function, you have to provide the unique ID of your extension. You can find this ID in the app.json file of your extension project. The second parameter expects the ID of your wizard page, and in the third parameter, you can add the name that should appear on the Assisted Setup page. The last parameter is used to indicate to which group your wizard belongs. The available values are defined in an enum: Assisted Setup Group. This enum can be extended with an enum extension object to create your own groups.

During installation, you can use an Install codeunit to add your wizard to Assisted Setup with the Add function. You can also subscribe to the OnRegister event in the Assisted Setup codeunit. This event notifies you that the list of assisted setup guides is being created. You can call the Add function from within your subscriber.

The following example shows how the OnRegister event and the Add function are used.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Assisted Setup", 'OnRegister', 
                 '', true, true)]
local procedure OnRegisterAssistedSetup()
var
    AssistedSetup: Codeunit "Assisted Setup";
    CurrentModuleInfo: ModuleInfo;
begin
    NavApp.GetCurrentModuleInfo(CurrentModuleInfo);
    if not AssistedSetup.Exists(CurrentModuleInfo.Id,  
                                Page::"Company Setup Wizard") then
        AssistedSetup.Add(CurrentModuleInfo.Id, 
                          Page::"Company Setup Wizard", 
                          'Set up your company', 
                          "Assisted Setup Group"::GettingStarted);
end;

At the end of the wizard, you can call the Complete function on the Assisted Setup codeunit, or you can subscribe to the OnAfterRun event and run the Complete function. This event notifies you that the run of the assisted setup has finished.