6
Is your feature request related to a problem? Please describe.
Current implementation of Error messages stops all user actions, requires a page refresh or revalidate input if possible. The better way of handling was implemented in incoming documents, where all errors are collected and shown in seperate page part with some availability to go to some page.

Describe the solution you'd like
Notifications currently allow to add custom actions. It would be good way to implement error notfications, where error notification still rolls back the transaction, but allows for custom added actions where user could fix the couse of error by just choosing the action if available.
To extend even further it would be great to collect these error notifications before throwing them and stopping transaction.

Describe alternatives you've considered
Alternatives are implemented in incoming document functionality, but it does not allow to add custom actions. It also requires additional page parts which lets say in document is one page part too many.

I imagine something like:
ErrorNotification.SetRecord(Rec);//Save record reference to be used in procedures
ErrorNotification.Handle(Rec.Testfield(Field1)).AddAction(MyLocalProcedure);//CatchError and AddAction
//Add handlers like in test codeunit Assert
ErrorNotification.HandleIsNotEmpty(Rec.Field2);
ErrorNotification.HandleIsGreaterThen(Rec.Field3, Rec.Field4);
if SomeCondition then
ErrorNotification.AddError('SomeConditionError').AddAction('MyLocalProcedure2');
if not ErrorNotification.IsEmpty then
ErrorNotification.ThrowError;

Finaly platform could make sure that errors unhandled by code would automaticaly be validated and an error would be thrown before commiting to database.
STATUS DETAILS
Completed
Ideas Administrator

Thank you for your feedback. We released this feature as part of the functionality in Check Documents and Journals while you work.

Please refer to the following link for more information:


Sincerely,
Business Central Team