How to show multiple error logs and then stop the execution. #ax #dynamics #d365
Views (31)
Here, I'm going to show how to show multiple errors and then stop the process by code. I required to show multiple errors in the different error logs and then stop the execution after the last error.
boolean haveErrors;
while select * from inventQualityOrderLine
where inventQualityOrderLine.QualityOrderId == qualityOrderId
{
error('Error found'); // Display error
haveErrors = true;
}
if (haveErrors)
{
throw Exception::error; // Stop execution
}
boolean haveErrors;
while select * from inventQualityOrderLine
where inventQualityOrderLine.QualityOrderId == qualityOrderId
{
error('Error found'); // Display error
haveErrors = true;
}
if (haveErrors)
{
throw Exception::error; // Stop execution
}

Like
Report
*This post is locked for comments