How to handle Generic Exceptions in AX


Today I will demonstrate you that how you can handle generic exceptions in AX.

     Below is the example of code which we can use to handle generic exceptions:-

        Static void Exception_Handler(Args _args)
       {
           Exception excep;
           int x,y,z;
           x=10;
           y=0;
               try
                 {
                     z=x/y;
                      print z;
                       pause;
                 }
               catch
                 {
                     info(strfmt("%1",excep));
                  }
                
        }

Comments