I have come to a requirement where I need to change the values of labels defined in AX on run-time using X++. So, after some initial workout I found the solution to it.
For this solution you need to use SysLabelEdit class.
Click here SysLabelEdit class.
static void LabelChangeJob(Args _args)
{
SysLabelEdit sysLabelEditLocal;
sysLabelEditLocal = new sysLabelEdit();
info(strFmt('Before Label changes : %1', "@IQL112"));
sysLabelEditLocal.labelModify('en-us', sysLabelEditLocal.findLabel('en-us', 'Testing Label 1'), "Testing Label", "", SysLabelApplModule::None);
info(strFmt('After Label changes : %1', "@IQL112"));
}
For this solution you need to use SysLabelEdit class.
Click here SysLabelEdit class.
static void LabelChangeJob(Args _args)
{
SysLabelEdit sysLabelEditLocal;
sysLabelEditLocal = new sysLabelEdit();
info(strFmt('Before Label changes : %1', "@IQL112"));
sysLabelEditLocal.labelModify('en-us', sysLabelEditLocal.findLabel('en-us', 'Testing Label 1'), "Testing Label", "", SysLabelApplModule::None);
info(strFmt('After Label changes : %1', "@IQL112"));
}