Dynamics 365 Business Central: How to display a custom Application Version (e.g., from W1 28.0 to YUN ZHU 28.0)

Dynamics 365 Business Central

Hi, Readers.
Today I would like to talk about an interesting topic, how to display a custom Application Version (e.g., from W1 28.0 to YUN ZHU 28.0).

From the Help pane, you can access the Help & Support page inside Business Central that includes helpful links.

On the Troubleshooting section, you can find the most complete version information for the current environment. For example,
Version: W1 28.0 (Platform 28.0.48307.0 + Application 28.0.46665.49032)

Version: US Business Central 28.0 (Platform 28.0.48307.0 + Application 28.0.46665.48632)

You can use codeunit 9015 “Application System Constants” to get this information. More details: Dynamics 365 Business Central: How to get the full version text in Help & Support via AL (Record daily version information)

Did you know that we can display a custom Application Version? Let’s look at a simple example.

Done.

Test code:

codeunit 50112 EventHandlers
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Version Triggers", GetApplicationVersion, '', false, false)]
    local procedure "VersionTriggers_GetApplicationVersion"(var Version: Text[248])
    begin
        Version := 'YUN ZHU BC Japan 28.0';
    end;
}

This is achieved by leveraging the following event.
codeunit 2000000001 “Version Triggers” -> procedure GetApplicationVersion

However, I personally suggest keeping the original Application Version and then adding the content you need, such as your company name. For example,

Test code:

codeunit 50112 EventHandlers
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Version Triggers", GetApplicationVersion, '', false, false)]
    local procedure "VersionTriggers_GetApplicationVersion"(var Version: Text[248])
    var
        AppSysConstants: Codeunit "Application System Constants";
    begin
        Version := 'YUN ZHU ' + AppSysConstants.ApplicationVersion();
    end;
}

Great, give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL