Alert without disable ajax

Hello everybody;
in a recent post (see here) i added an appendErrorMessage in an after_save logichook. It works fine and the message is displayed.
Unfortunately i noticed an issue and i hope someone of you can help me :frowning:

i go to the aos_quotes module and in the list view i set up a filter (that gives me 100 results). Then i click on a record and i enter the detail view of the first record.
So in the top/right i have the count 1 of 100 Previous - Next …correct?

well, after i created the logichook, when i save a record from the edit view (coming from the filtered list view), the filter become disabled and the 1 of 100 Previous - Next disappears.

I tryed to disable the ajax, but after this, none of alert is shown.
Have you got some advice for me?

Another question: Is it possible in your opinion to insert the appendErrorMessage in the detail view?

In your module view.detail.php you can add the alert in display function.


 public function display()
   {
      
      parent::display();
      echo '<script type="text/javascript" src="custom/modules/mymodule/custom.js?v' . time() . '"></script>';
      // or add the JS alert only
      echo '<script type="text/javascript"> alert("My Alert");</script>';
   }
1 Like