Thursday, June 9, 2022

Throw exception from Catch block - New feature after PU 31 in D365FO

Hi All,
Lets understand this new feature to throw the exception from catch block .

Now we can use throw from catch block. This way throw will work like re-throw and send cached exception to the outer catch block. Lets understand it by sample code.

X++ Code.
try
{
    throw Exception::error;
}
catch
{
    // locally handle exception
    // then rethrow for caller
    throw;
}


Thank you.

No comments:

Post a Comment

How to add Personnel Number field on the data entity D365FO

How to Add Personnel Number Field on the Data Entity in D365FO How to Add Personnel Number Field on the Data En...