14 November 2021

Exception handling in D365 FO - Capture the exception

System.Exception        ex;

 try

{

    // total logic

 }

            catch(ex)

            {

                System.String messageEx = ex.Message;

                info(strFmt("Exception: %1",messageEx));

            }

            catch (Exception::CLRError)

            {

                ex = CLRInterop::getLastException().GetBaseException();

                error(ex.get_Message());

            }

No comments:

Post a Comment

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.