what is retry in x++

 -> A retry can be written in a catch block to jump back to the first line of code within the try block. 


-> This can be used if the issue in the implementation can be fixed by code in the catch block.


-> Then, the try block will run again to give it a second chance to succeed. 


****

-> Make sure that the retry does not cause an infinite loop. 


Example:



try

{

//Run some code that might throw a numeric or other type of exception.

}

catch (Exception::Numeric)

{

info('Found a Numeric exception.');

}

catch

{

info('Caught an exception');

retry;

}

finally

{

        // Executed no matter how the try block exits.

}

Comments

Popular posts from this blog

How to Create a wizard in x++ d365

how to post trade agreement journals automatically using x++ code

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O