Microsoft_MVP_banner

How Exception handling Try/Catch statements work in AX

A sample code for Try/Catch statements in AX under run method in a class.

public void
run()
{
   
#OCCRetryCount
   
    try
    {
       
    }
    catch (Exception::Deadlock)
    {
        retry;
    }
    catch (Exception::UpdateConflict)
    {
        if (appl.ttsLevel() == 0)
        {
            if (xSession::currentRetryCount() >=
#RetryNum)
            {
               
throw
Exception::UpdateConflictNotRecovered;
            }
            else
            {
               
retry;
            }
        }
        else
        {
            throw Exception::UpdateConflict;
        }
    }
}

Share:

Send Us A Message

Leave a Reply

Your email address will not be published. Required fields are marked *

FaisalFareed@2025. All rights reserved

Design by T3chDesigns