I call a service function inside the performAction method of custom element-action and I'd like to show an error message to user if the service function returned false.

I was able to set success message by using:


But I don't know how to set an error message i.e. with red background.


I know this is a late reply. I hope it will help others.

You need to return false; so that the background color is red.


     if (count($criteria->ids()) > 1)

         return false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.