Tuesday, August 28, 2007

Get field label in X++

Scenario: I want to use the label of a field in code.

Answer: Use SysDictField class

SysDictField dict = new SysDictField(tableId, fieldId);
str label = dict.label();


  1. static void Job40(Args _args)
    str label;

    //Get label of field
    label = fieldPName(EmplTable, EmplId);
    info('Field name: '+label);

    //Get label of EDT:
    label = new SysDictType(extendedTypeNum(EmplId)).label();
    info('EDT name: '+label);

    //Get label of table
    label = tablePName(EmplTable);
    info('Table name: '+label);

    1. Great Article Cyber Security Projects projects for cse Networking Security Projects JavaScript Training in Chennai JavaScript Training in Chennai The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training