Displaying Error Message from after_save hook

I’ve got an after_save custom hook that creates a matching invoice in an external accounting system when and invoice is saved in the AOS_Invoices module

Sometimes the external accounting system API returns an error that the invoice wasn’t created (usually due to a missing product id.)

What are my options for techniques to allow the after_save hook to display an Error message to the SuiteCRM user after they save the invoice? Seems like it would have to be a pop-up or embed the error message in the resulting Invoice detail display? How?

You can make record in module “Alerts”.

You should something like

	        SugarApplication::appendErrorMessage('Error: Invoice could not be created');

in your logic hook.