The code below will help out in fetching current user Information in D365 FO using X++.
class getCurrentUserInfo
{
/// <summary>
/// this method used to get current user detail
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
info(strfmt("Current User - %1",curUserId()));
info(strfmt("User Account Type - %1",xUserInfo::find(false,curUserId()).accountType));
}
}
Output will look something like this:
class getCurrentUserInfo
{
/// <summary>
/// this method used to get current user detail
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
info(strfmt("Current User - %1",curUserId()));
info(strfmt("User Account Type - %1",xUserInfo::find(false,curUserId()).accountType));
}
}
Output will look something like this:
THANK YOU
Excellent Topic sir, keep it up.... post more on AX 7
ReplyDeleteThank you
Delete