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)

Third party component/Dll exception handling

(0) ShareShare
ReportReport
Posted on by 1,559

Hi Friends,

We are using QASProOnDemand for address checking, most of time, it works great.

But, once a while, we got exception, actually, it erred out without throw exception since we couldn't catch exception.

I am not sure others experience similar problem. How can I do to handle it?

Thanks,

River

*This post is locked for comments

I have the same question (0)
  • Ganriver1 Profile Picture
    1,559 on at

    FYI, here is call stack :

    [s]    \Classes\Application\ttsNotifyAbort                                                                     5

    [s]    \Classes\CLRObject\CanSearch                                                                            

    [s]    \Classes\QASProOnDemandService\CheckAddress                                                          46

    Try block couldn't catch any exceptions:-(

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    HI Ganriver,

    You need to catch Exception::CLRError and this catch should be outside of any transactions.

    It's hard to say more without seeing actual code.

  • Ganriver1 Profile Picture
    1,559 on at

    Hi Ievgen,

    That's what I did, see code, only thing it's inside transaction.

    Why it should be outside of transaction, we use a wrapper class to call 'checkaddress' method of QASProOnDemand.

    Thanks,

    River

       try

       {

           clientFactory = new QASProOnDemand.QASClientFactory();

           engine = clientFactory.createEngine(#QASURL, #UserName, #Password);

           canSearch = clientFactory.CanSearch(engine , qasCountry, qasLayout);

       }

       catch(Exception::CLRError)

       {

           error("An error occurred with the QAS service");

       }

  • Verified answer
    Martin Dráb Profile Picture
    237,953 Most Valuable Professional on at

    AX doesn't allow catching exceptions inside transactions (with a few exception, which don't apply to your case). AX aborts the transaction and continues execution after the transaction, therefore your exception handling code inside the transaction is skipped.

  • Ganriver1 Profile Picture
    1,559 on at

    Thanks a lot! Guys.

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans