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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Exception handling during a transaction

(0) ShareShare
ReportReport
Posted on by 35
Hi,
 
I have created an extension class for SalesConfirmJournalPost  to send salesOrderData on click of ConfirmSO to external system via http post call.
When the Http call is giving System.Net.WebException, it is not going to catch block, instead rollback is happening.
 
 
Please suggest, is there any way to handle the exceptions to perform some logic in catch block.
I have the same question (0)
  • Kevin Xia Profile Picture
    Microsoft Employee on at
    Hi,
    If you're facing a situation where a System.Net.WebException is not reaching the catch block and is causing an automatic rollback, here are some suggestions:
    Use of try-catch block:
    Ensure that your code is wrapped in a try-catch block appropriately. For example:

    Check TransactionScope:
    If you are using a TransactionScope in your code, be aware that unhandled exceptions might cause automatic rollbacks. Ensure that you are handling exceptions within the scope of your transaction.
    Logging:
    Implement logging within your catch block to capture the details of the exception. This can help you analyze the cause of the WebException and debug the issue.
    Best regards,
    Kevin
  • PP-08051102-0 Profile Picture
    35 on at
    Hi Kevin,
     
    Thanks for your reply..
    I am doing the same way as you suggested, but still System.Net.WebException is not reaching catch block,
    May be due to transactional scope, it is not handling exception or any other reason, not sure!!.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 591

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 550 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 543 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans