Exercise: Build a guided role experience
In this exercise, you build a customer follow-up role that uses the standard Business Manager Role Center and Customer List. The extension adds a profile-specific view, contextual assistance, and a guide that stores follow-up defaults only when the user finishes setup.
Use object IDs 70700–70799 for this exercise. Create the objects in an AL project that targets your Business Central online sandbox.
Create the profile and role view
Create a file named CustomerFollowUpProfile.Profile.al, and add the following profile:
profile "Customer Follow-up"
{
Caption = 'Customer Follow-up';
Description = 'Role for users who monitor active customer accounts.';
ProfileDescription = 'Review active customers and complete follow-up setup.';
RoleCenter = "Business Manager Role Center";
Customizations = "Cust Follow-up Customization";
Enabled = true;
Promoted = true;
}
Create CustomerFollowUpCustomization.PageCustomization.al. The customization adds a shared-layout view only for users assigned to the profile.
pagecustomization "Cust Follow-up Customization" customizes "Customer List"
{
views
{
addfirst
{
view(ActiveCustomers)
{
Caption = 'Active customers';
Filters = where(Blocked = const(" "));
OrderBy = ascending(Name);
}
}
}
}
Because the view doesn't define a layout section, it shares the Customer List layout and user personalization. Its filter and sort order remain extension-owned.
Add contextual assistance
Create CustomerFollowUpList.PageExt.al. The page teaching tip explains the role task, the control teaching tip highlights the customer name, and the action provides an entry point to setup.
pageextension 70700 "Cust Follow-up List Ext" extends "Customer List"
{
AboutTitle = 'About customer follow-up';
AboutText = 'Review active customer accounts and start the setup guide for consistent follow-up.';
layout
{
modify(Name)
{
ToolTip = 'Specifies the customer name used in follow-up activities.';
AboutTitle = 'Identify the account';
AboutText = 'Use the customer name to confirm that follow-up is applied to the intended account.';
}
}
actions
{
addlast(Processing)
{
action(SetUpCustomerFollowUp)
{
ApplicationArea = All;
Caption = 'Set up customer follow-up';
Image = Setup;
RunObject = page "Cust Follow-up Wizard";
ToolTip = 'Open the guide that configures default customer follow-up settings.';
AboutTitle = 'Choose follow-up defaults';
AboutText = 'Use the guide to set a reminder interval and decide whether follow-up focuses on active customers.';
}
}
}
}
The action tooltip defines what the action opens. Its teaching tip explains the outcome and becomes a tour step.
Build and register the setup guide
Create CustomerFollowUpSetup.Table.al for the persistent settings. The blank primary key supports one setup record per company.
table 70700 "Cust Follow-up Setup"
{
Caption = 'Customer Follow-up Setup';
DataClassification = CustomerContent;
fields
{
field(1; "Primary Key"; Code[10])
{
Caption = 'Primary Key';
DataClassification = SystemMetadata;
}
field(2; "Reminder Days"; Integer)
{
Caption = 'Reminder Days';
MinValue = 1;
DataClassification = CustomerContent;
}
field(3; "Show Only Active"; Boolean)
{
Caption = 'Show Only Active Customers';
DataClassification = CustomerContent;
}
}
keys
{
key(PK; "Primary Key")
{
Clustered = true;
}
}
}
Create CustomerFollowUpWizard.Page.al. The page edits a temporary record, exposes three steps, and writes the setup only when the user selects Finish.
page 70700 "Cust Follow-up Wizard"
{
PageType = NavigatePage;
SourceTable = "Cust Follow-up Setup";
SourceTableTemporary = true;
Caption = 'Set up customer follow-up';
layout
{
area(Content)
{
group(WelcomeStep)
{
Caption = 'Welcome';
InstructionalText = 'Use this guide to choose defaults for customer follow-up work.';
Visible = WelcomeStepVisible;
}
group(SettingsStep)
{
Caption = 'Follow-up defaults';
InstructionalText = 'Choose when reminders are due and which customers the role focuses on.';
Visible = SettingsStepVisible;
field(ReminderDays; Rec."Reminder Days")
{
ApplicationArea = All;
ToolTip = 'Specifies the number of days before a customer follow-up reminder is due.';
}
field(ShowOnlyActive; Rec."Show Only Active")
{
ApplicationArea = All;
ToolTip = 'Specifies whether follow-up work focuses on customers that aren't blocked.';
}
}
group(FinishStep)
{
Caption = 'Ready to finish';
InstructionalText = 'Select Finish to save the settings and complete the guide.';
Visible = FinishStepVisible;
}
}
}
actions
{
area(Processing)
{
action(Back)
{
ApplicationArea = All;
Caption = '&Back';
Enabled = BackEnabled;
InFooterBar = true;
Image = PreviousRecord;
ToolTip = 'Return to the previous step.';
trigger OnAction()
begin
MoveStep(true);
end;
}
action(Next)
{
ApplicationArea = All;
Caption = '&Next';
Enabled = NextEnabled;
InFooterBar = true;
Image = NextRecord;
ToolTip = 'Continue to the next step.';
trigger OnAction()
begin
MoveStep(false);
end;
}
action(Finish)
{
ApplicationArea = All;
Caption = '&Finish';
Enabled = FinishEnabled;
InFooterBar = true;
Image = Approve;
ToolTip = 'Save the follow-up settings and complete the guide.';
trigger OnAction()
begin
SaveSetup();
CurrPage.Close();
end;
}
}
}
trigger OnOpenPage()
begin
if FollowUpSetup.Get() then begin
Rec := FollowUpSetup;
Rec.Insert();
end else begin
Rec.Init();
Rec."Primary Key" := '';
Rec."Reminder Days" := 7;
Rec."Show Only Active" := true;
Rec.Insert();
end;
Step := Step::Welcome;
SetControls();
end;
var
FollowUpSetup: Record "Cust Follow-up Setup";
GuidedExperience: Codeunit System.Environment.Configuration."Guided Experience";
Step: Option Welcome,Settings,Finish;
WelcomeStepVisible: Boolean;
SettingsStepVisible: Boolean;
FinishStepVisible: Boolean;
BackEnabled: Boolean;
NextEnabled: Boolean;
FinishEnabled: Boolean;
local procedure MoveStep(Backwards: Boolean)
begin
if Backwards then
Step := Step - 1
else
Step := Step + 1;
SetControls();
end;
local procedure SetControls()
begin
WelcomeStepVisible := Step = Step::Welcome;
SettingsStepVisible := Step = Step::Settings;
FinishStepVisible := Step = Step::Finish;
BackEnabled := Step <> Step::Welcome;
NextEnabled := Step <> Step::Finish;
FinishEnabled := Step = Step::Finish;
end;
local procedure SaveSetup()
begin
if not FollowUpSetup.Get() then begin
FollowUpSetup.Init();
FollowUpSetup."Primary Key" := '';
FollowUpSetup.Insert();
end;
FollowUpSetup."Reminder Days" := Rec."Reminder Days";
FollowUpSetup."Show Only Active" := Rec."Show Only Active";
FollowUpSetup.Modify();
GuidedExperience.CompleteAssistedSetup(
ObjectType::Page,
Page::"Cust Follow-up Wizard");
end;
}
Create CustomerFollowUpRegistration.Codeunit.al to register the page with Guided Experience.
codeunit 70700 "Cust Follow-up Registration"
{
[EventSubscriber(ObjectType::Codeunit,
Codeunit::System.Environment.Configuration."Guided Experience",
OnRegisterAssistedSetup, '', true, true)]
local procedure InsertAssistedSetup()
var
GuidedExperience: Codeunit System.Environment.Configuration."Guided Experience";
AssistedSetupGroup: Enum System.Environment.Configuration."Assisted Setup Group";
VideoCategory: Enum System.Media."Video Category";
begin
GuidedExperience.InsertAssistedSetup(
'Set up customer follow-up',
'Customer follow-up',
'Choose defaults for customer follow-up work.',
5,
ObjectType::Page,
Page::"Cust Follow-up Wizard",
AssistedSetupGroup::ReadyForBusiness,
'',
VideoCategory::Uncategorized,
'',
true);
end;
}
Publish and validate the experience
Publish the extension to your sandbox, and complete the following checks:
- Open My Settings, select the Customer Follow-up role, and reload the client.
- Open Customers, and confirm that Active customers is the first available view.
- Confirm that the view excludes blocked customers and sorts customer names in ascending order.
- Open the teaching tip from the page title, and start the tour. Confirm that the customer name and setup action have distinct, outcome-focused tips.
- Run Set up customer follow-up, change the reminder interval, and close the guide before Finish. Reopen it and confirm that the abandoned value wasn't stored.
- Finish the guide with a new reminder interval.
- Search for Assisted Setup, and confirm that Set up customer follow-up is marked as completed.
- Reopen the guide, and confirm that it loads the saved settings.
The final behavior should map cleanly to the design: the profile owns the role assignment, the page customization owns the role-specific view, the page extension owns behavioral assistance and the setup entry point, the wizard owns temporary interaction, and Guided Experience owns discoverability and completion status.