Dynamics365forOps: Creating extensions for Label files
Views (103)
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.
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')); } }
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.
This was originally posted here.
*This post is locked for comments