I often find myself raising errors the "old way with Error('some error message'); just because its so much easier to type.
The idea is to create a wrapper codeunit with all the procedures build in a way that every aspect of the ErrorInfo type is optional via parameters, and every function will return the ErrorInfo type.
That way we can easily create an ErrorInfo object inline without the need to create long functions.
Example:
Error(
ErrorInfo.Create()
.Message('Something went wrong')
.SetTableId(Database::MyTable)
.AddNavigationAction('ShowMe')
.AddAction('FixIt',Codeunit::FixErrorHelper, 'FixTheError')
);
For complex scenarios, this wont improve readability of course, and its not the intention of course, its more to make it easier to uptake ErrorInfo more easily.
I will provide the implementation for this BC Idea
[X] I will provide the implementation for this BC Idea
BC Idea Link
https://experience.dynamics.com/ideas/idea/?ideaid=57c2f6a4-ca39-ef11-a295-6045bd84c2f2
Description
I often find myself raising errors the "old way with Error('some error message'); just because its so much easier to type.
The idea is to create a wrapper codeunit with all the procedures build in a way that every aspect of the ErrorInfo type is optional via parameters, and every function will return the ErrorInfo type.
That way we can easily create an ErrorInfo object inline without the need to create long functions.
Example:
For complex scenarios, this wont improve readability of course, and its not the intention of course, its more to make it easier to uptake ErrorInfo more easily.
I will provide the implementation for this BC Idea