web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

System.DirectoryServices.DirectoryEntry invoke

(0) ShareShare
ReportReport
Posted on by 195

Hi.

I use System.DirectoryServices.DirectoryEntry to create a user on ActiveDirectory.  I can create and I can setpasswrord.

But my problem is, when I set a password, I can't catch the error if the password doesn't respect the password rules.  AX stop on the method INVOKE("SetPassword", ...) and not on the catch(Exception::Error)

When I set a good password, it's works fine.  So, I would like to use the Try Catch and return some error message.

any idea ???

Regards

Dany

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Denis Patrakov Profile Picture
    on at

    Use catch(Exception::ClrError) instead. See also AifUtil::getClrErrorMessage() - you can use it inside the catch block.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans