Using collectible errors
When creating AL code in a Dynamics 365 Business Central extension, sometimes you need to throw errors to users. The standard way of throwing an error in AL is by using the Error() construct:
ERROR(String [, Value1, …])
When an error occurs, the code stops immediately at the first error it meets and the transaction is rolled back.Sometimes in a business process you can have the need to capture multiple error messages and then display them in the user interface in a collected way, without stopping the user on every error occurrence. In AL you can do that by using collectible errors. By using collectable errors the AL code execution is not stopped on every error occurrence but you postpone the error handling at the end of your code block.When using collectible errors, the ErrorInfo AL data type defines informations about the error. For handling collectible errors, the ErrorBehavior attribute of a method specifies the behavior of collectable errors inside...