Hi,
To get the Current Logged In Company you can Use the curExt() function in AX.
for current User Id use curUserId() function
for date use SystemDateGet() function
static void curExtExample(Args _arg)
{
str CompanyId, UserId;
date CurrentDate;
;
CompanyId = curExt();
UserId = curUserId();
CurrentDate = SystemDateGet();
Info(StrFmt("%1 %2 %3", CompayId, UserId, CurrentDate)
}
You would also get the same result with below code as well.
static void curExtExample(Args _arg)
{
str CompanyId;
;
CompanyId = CompanyInfo::Find().DataAreaId;
Info(CompanyId);
}
Komentar
Posting Komentar