Identified the Ax user on X++ code

I need to identify the user on the X++ code something like that:

if (function.userax== ) {

do something
} else {

do something

}

Hi,

If you want to identify an user, you can use the curuserId() variable, it returns the current user login,

hope it helps,

Regards,

Thomas

Hello,

You can check current user using curuserId() method.

Regards,

Varun Garg

Great. Thanks for the help.

This forum has save my work.

hii…

Try this job…

Static Name getCurUsername()
{
str r;
;
r = XUserInfo::find(false, curUserId()).name;

info(r);
return r;
}