Create a Custom Headline

Improving Onboarding

This post provides a quick example of how to customise the welcome banner, which is shown as part of the onboarding checklists, and headlines shown on the Role Centers in Business Central. By creating a small extension I’ll show you a very simple example. For the banner, we need to subscribe to the OnBeforeUpdateBannerLabels event to replace the standard text. For the headline, we will extend the role centers to add in a new message in addition to the standard.

The Welcome Banner

Banner Example

The welcome banner in Business Central is an introductory message displayed to users as part of the setup checklists. It will be shown in new companies when first setting up the system. By customising this banner, you can provide a more tailored onboarding experience to welcome the users to their new system. To replace the standard welcome text we simply eed to subscribe to the event OnBeforeUpdateBannerLabels in the Checklist Banner codeunit.

You will notice that we need to provide a Title, a Header and a Description. For title and header, there are two variants, expanded or collapsed. The collapsed variant is shown here below the headline:

Collapsed Banner Example

For the description, we should also define the welcome text that will be shown before the setup checklists and after they have been started using the if statement in the code below.

Sample Code – Banner Subscriber

codeunit 50600 "Banner Subscriber"
{
  EventSubscriberInstance = StaticAutomatic;
  [EventSubscriber(ObjectType::Codeunit, Codeunit::"Checklist Banner", 'OnBeforeUpdateBannerLabels', '', false, false)]
  local procedure MyCustomOnBeforeUpdateBannerLabels(var IsHandled: Boolean; IsEvaluationCompany: Boolean; var TitleTxt: Text; var TitleCollapsedTxt: Text; var HeaderTxt: Text; var HeaderCollapsedTxt: Text; var DescriptionTxt: Text; IsSetupStarted: Boolean; AreAllItemsSkippedOrCompleted: Boolean)
  
  
  
  begin
      TitleTxt := 'Phils BC Blog Business Central System';
      TitleCollapsedTxt := 'Start now with ';
      HeaderTxt := 'Welcome to Phils BC Blog Business Central System';
      HeaderCollapsedTxt := 'Phils BC Blog';
      if IsSetupStarted = true then
          DescriptionTxt := 'Business Central has been designed to be simple to setup and quick to get started. Follow our guided checklist to set up'
      else
          DescriptionTxt := 'Microsoft Dynamics 365 Business Central, a revolutionary finance solution tailored specifically for BC Blog. Click to get started...';

      IsHandled := true;
  end;
}

The Headline

Headline Example

In Business Central, the headline is displayed on role centers. It provides key information, prompts, and links to important areas of the system. Customising the headline allows you to tailor the user experience and display custom messages, links, or guidance as required.

Adding it is super simple, you just need to create a page extension for each of the Role Center Headline pages that require the customisation. The code below shows a basic example and uses the OnDrillDown trigger to link to an external URL so the user can click the link. We’re just adding one to an existing headline but you can add as many as you need to and create a new headline page to use in your own role center.

For the text displayed, we declare a variable hdl1Txt as a label. This is the text to display but we need also need to define the expression property. This is to set the title , the main text and to highlight text with .

Expression Property

How the expression is used

Sample Code – Extend Role Center Headline

Here’s how you can extend the Headline RC Business Manager page:

pageextension 50602 HeadlineBM extends "Headline RC Business Manager"
{
layout
  {
      addfirst(content)
      {
          
          field(Headline1; hdl1Txt)
          {
              ApplicationArea = All;
              ToolTip = 'Headline 1';
              Caption = 'Headline 1';

              
              trigger OnDrillDown()
              var
                  DrillDownURLTxt: Label 'https://www.berrill.net', Locked = true;
              begin
                  Hyperlink(DrillDownURLTxt)
              end;
          }
      }
  }
  var
      hdl1Txt: Label 'Welcome toPhil Berrill's/emphasize> Business Central System/payload>';
}

For further details on both of these topics, check out the official Microsoft Learn documentation:

Source Code

The complete source code for this example is available in this GitHub repo. Feel free to clone, modify, and contribute!

Original Post https://berrill.net/blog/custom-headline/

Leave a reply

Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...