Notifications
Announcements
No record found.
UserInfo userInfo;xAxaptaUserManager Axmanage;xAxaptaUserDetails Axdetails;Boolean ret = false;Axmanage = new xAxaptaUserManager();userInfo.initValue();userInfo.accountType = UserAccountType::ClaimsUser;userInfo.networkAlias = networkAlias;userInfo.networkDomain = networkDomain ;userInfo.id = userId;userInfo.name = userName;userInfo.company = defaultCompany;userInfo.enable = NoYes::Yes;userInfo.helplanguage = 'en-Us';userInfo.language = 'en-Us';Axdetails = Axmanage.getSIDFromName(userInfo.id, userInfo.NetworkDomain, UserAccountType::ClaimsUser);userInfo.sid = Axdetails.getUserSid(0);userInfo.ObjectId = SysSecurity::getUserObjectIdForPrincipalName(userInfo.NetworkAlias);userInfo.insert();
UserInfo userInfo; xAxaptaUserManager Axmanage; xAxaptaUserDetails Axdetails; Boolean ret = false; Axmanage = new xAxaptaUserManager(); userInfo.initValue(); userInfo.accountType = UserAccountType::ClaimsUser; userInfo.networkAlias = networkAlias; userInfo.networkDomain = networkDomain ; userInfo.id = userId; userInfo.name = userName; userInfo.company = defaultCompany;userInfo.enable = NoYes::Yes; userInfo.helplanguage = 'en-Us'; userInfo.language = 'en-Us'; Axdetails = Axmanage.getSIDFromName(userInfo.id, userInfo.NetworkDomain, UserAccountType::ClaimsUser); userInfo.sid = Axdetails.getUserSid(0); userInfo.ObjectId = SysSecurity::getUserObjectIdForPrincipalName(userInfo.NetworkAlias); userInfo.insert();
using Microsoft.Dynamics.ApplicationPlatform.Environment; using Microsoft.Dynamics.ApplicationPlatform.XppServices.Instrumentation; using Microsoft.Dynamics.AX.Security.AuthenticationCommon; using Microsoft.Dynamics.Ax.Xpp.AxShared.Instrumentation; using XppLogger = Microsoft.Dynamics.ServiceFramework.Instrumentation.Xpp; using Microsoft.Extensions.Logging; class userCreationClass { public str createUser() { UserInfo userInfo; xAxaptaUserManager Axmanage; xAxaptaUserDetails Axdetails; container packedList; ListIterator iterator; boolean ret = false; Axmanage = new xAxaptaUserManager(); list split = strSplit(worker.email(), "@"); iterator = new ListIterator(split); while(iterator.more()) { packedList += iterator.value(); iterator.next(); } userInfo.initValue(); userInfo.accountType = UserAccountType::ClaimsUser; userInfo.networkAlias = worker.email(); userInfo.networkDomain = EnvironmentFactory::GetApplicationEnvironment().get_Provisioning().get_AdminIdentityProvider(); userInfo.IdentityProvider = Microsoft.Dynamics.AX.Security.AuthenticationCommon.AadHelper::GetCanonicalIdentityProvider(UserInfo.networkDomain);; userInfo.id = conPeek(packedList, 1); userInfo.name = worker.name(); userInfo.company = defaultCompany; userInfo.enable = NoYes::Yes; userInfo.helplanguage = 'en-Us'; userInfo.language = 'en-Us'; Axdetails = Axmanage.getSIDFromName(UserInfo.networkAlias, UserInfo.IdentityProvider, UserInfo.accountType); userInfo.sid = Axdetails.getUserSid(0); userInfo.ObjectId = SysSecurity::getUserObjectIdForPrincipalName(userInfo.NetworkAlias); userInfo.insert(); return userInfo.id; } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional