mandag den 20. juli 2009

Extracting text from a label.

How to extract label text.

This code shows how to get the text of a specific label for a specific module, for a specific language.

This might come in handy when constructing a text to be printed on a report, that will more than one label text.


// This code allows you to extract the label text of a specific label, for a specific module,
// for a specific language
//
// Handy when constructing text fields containing many values and labels for printing
//
// str = labeltxt("gls",element.design().languageId(),200);

str labeltxt(str _labelModule,LanguageId _languageId, LabelIdNum _labelNo)
{
    Label l;
    l = new label(_languageId);
    return l.extractString(l.name(_labelModule,_labelNo));
}

1 kommentar:

  1. In AX 2012 you can do:
    SysLabel::labelId2String2(literalStr("@NDI2851"), _jour.LanguageId);

    SvarSlet