Label in Dynamics AX 2009
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
static void Jimmy_Label(Args _args)
{
session xSession;
Label label;
Container con;
LanguageId LanguageId;
int i;
;
con = xGlobal::languageList();
//valid language in dynamics AX 2009 for our company
for(i = 1; i <= conlen(con);i++)
print Conpeek(Conpeek(con,i),1), ' - ' ,Conpeek(Conpeek(con,i),2);
//current language
xSession = new session();
print xSession.interfaceLanguage();
print infolog.language();//ZH-Hans
//method 1 SysLabel::labelId2String2("@SYS12836",LanguageId); must be using literalstr method
for(i = 1; i <= conlen(con); i++)
{
LanguageId = conpeek(conpeek(con,i),1);//ZH-Hans,
print "method 1 : ",LanguageId," - " ,SysLabel::labelId2String2(literalstr("@SYS12836"),LanguageId);
}
//method 2 new label(LanguageId).extractString(literalstr("@SYS12836"));must be using literalstr method
for(i = 1; i <= conlen(con); i++)
{
LanguageId = conpeek(conpeek(con,i),1);
//print "method 2 : ",LanguageId," - " ,new label(LanguageId).extractString(literalstr("@SYS12836"));
print "method 2 : ",LanguageId," - " ,new label(LanguageId).extractString(literalstr("@SYS12836"));// Item number 物料编号
}
/**
print CuruserId();//Jimm1
print curext();//"QCN"
print Xglobal::machineTzDisplayName();//beijing str
print WinAPI::getComputerName();//QVSIT004
print WINAPI::getUserName();//Jimmyx
print System.DateTime::get_Now();//beiJing datetime
print DateTimeUtil::getClientMachineTimeZone();//beiJing
print DateTimeUtil::getCompanyTimeZone();//beiJing
print DateTimeUtil::getSystemDateTime();//UTC london datetime
print DateTimeUtil::utcNow();//UTC london datetime
print DateTimeUtil::getUserPreferredCalendar();//公历
print DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::utcNow(),DateTimeUtil::getClientMachineTimeZone());//Beijing dateTime
*/
pause;
}