Tuesday 20 June 2017

AX 7 : Finally in try/catch statements

Try/catch statements can now include an optional finally clause. The semantics are the same as they are in C# and other managed languages. The statements in the finally clause are executed when control leaves the try block, either normally or through an exception.

Example : 
try
  {
    // ...
  }
  catch
  {
    // Executes when any exception is thrown in the dynamic
    // scope in the try block.
  }
  finally
  {
    // Executed irrespective of how the try block exits.

  }

1 comment:

  1. I liked your blog.Thanks for your interest in sharing your ideas.keep doing more.
    Microsoft Dynamics AX Online Training

    ReplyDelete