The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.

TryMethod Property

Specifies the method to be try method, which can be used to catch and handle errors and exceptions that occur when code is run.

Applies to

AL Methods.


In test and upgrade codeunits, this property only applies to normal methods as specified by the MethodType Property (Test Codeunits) or MethodType Property (Upgrade Codeunits).


Try methods in AL enable you to handle errors that occur in the application during code execution. For example, with try methods, you can provide more user-friendly error messages to the end user than those thrown by the system. You can use try methods to catch errors/exceptions that thrown by Dynamics 365 Business Central or exceptions that are thrown during .NET Framework interoperability operations.

See Also

Essential AL Methods