web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Startspacers / Dynamics365forOps: Creating...

Dynamics365forOps: Creating extensions for Label files

Basheer17 Profile Picture Basheer17 2,720

We can create label extension files for existing labels. To do so we must name it with the “Name of the the label that you are extending”_Extension suffix. We can modify the string value of a label, add new labels and add new languages in the label extensions.

I have created SYS_Extension Label file for demonstration.

sys-labelsys-label-ext

In my SYS_Extension i have added a label @SYS1 which is already there in SYS label file and an extra label for test.

Below is the code for testing our newly created labels.

class LabelStringTest
{
    ///
<summary>
    /// Runs the class with the specified arguments.
    /// </summary>

    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        info(SysLabel::labelId2String2(literalStr("@SYS1"), 'en-US'));
        info(SysLabel::labelId2String2(literalstr('@SYS0'), 'en-US'));
        info(SysLabel::labelId2String2(literalstr('@SYS11445566'), 'en-US'));
    }

}

labelext-code

If we hover on the label id that we had extended, it would show the label from base label file (SYS). But in runtime it’ll fetch the label from label file extension.

labelext-op


This was originally posted here.

Comments

*This post is locked for comments