Hougaard.com – Applied Hacking

Meet the Codeunits: Assisted Setup

Codeunit 3725 manage setup wizards by allowing adding to the list and updating the status of each.

Coeunit 3725 replaces the functionality that was previously public on table 1808, so code like this:

[EventSubscriber(ObjectType::Table, Database::"Aggregated Assisted Setup", 'OnRegisterAssistedSetup', '', true, true)]
local procedure OnRegister(var TempAggregatedAssistedSetup: Record "Aggregated Assisted Setup")
var
    RecID: RecordId;
begin
 TempAggregatedAssistedSetup.AddExtensionAssistedSetup(50000,L,true,RecID,0,'');
end;

Will be turned into a subscriber to OnRegister() and a call to Add(). If you keep the Name as a label you can make calls to AddTranslation() to keep multiple languages in the same database.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Assisted Setup", 'OnRegister', '', true,true)]
local procedure MyProcedure()
var
    AssCodeunit : Codeunit "Assisted Setup";
    G : Guid;
    Name : Label 'Name of Setup';
    Grp : Enum "Assisted Setup Group";
begin
    G := 'c29774dd-d99f-42a1-9dd1-44b27b61bc21';
    AssCodeunit.Add(G,50000,Name,Grp::GettingStarted);
    AssCodeunit.AddTranslation(G,50000,1033,Name);
end;

https://github.com/microsoft/ALAppExtensions/blob/master/Modules/System/Assisted%20Setup

Add(ExtensionID: Guid; PageID: Integer; AssistantName: Text; GroupName: Enum “Assisted Setup Group”)
Add(ExtensionID: Guid; PageID: Integer; AssistantName: Text; GroupName: Enum “Assisted Setup Group”; VideoLink: Text[250]; HelpLink: Text[250])
Adds an assisted setup record from a given extension so that it can be shown in the list.
AddTranslation(ExtensionID: Guid; PageID: Integer; LanguageID: Integer; TranslatedName: Text)
Adds the translation for the name of the setup.
IsComplete(ExtensionID: Guid; PageID: Integer): Boolean
Check to see if an assisted setup has been completed.
[IntegrationEvent(false, false)]
procedure OnRegister()
You should register your assisted setup in this event. This replaces the old OnRegisterAssistedSetup event in table Aggregated Assisted Setup and the call to AddExtensionAssistedSetup.
Print Friendly, PDF & Email

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.