Im trying to use the RunAs command in AX2009, my code is as follows, but for some reason the code in method1 in the Class1 is not being executed. Anybody have any insight to what might be worng with this code ?
static void main(Args _args)
{
RunAsPermission perm;
UserId runAsUser;
SysUserInfo userInfo;
;
userInfo = SysUserInfo::find('abc');
runAsUser = userInfo.Id;
perm = new RunAsPermission(runAsUser);
perm.assert();
RunAs(runAsUser, classnum(Class1), "method1");
CodeAccessPermission::revertAssert();
}
*This post is locked for comments
I have the same question (0)