London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I want to be able to prevent delete (from Commerce Manager) of an Organization when certain criterias are met, i.e. it has Contacts tied to it.
What is the best approach to do this?
I have looked into doing a Handler/IPlugin that listens to the delete event ( https://world.episerver.com/documentation/developer-guides/commerce/business-foundation/Working-with-entity-objects/). But how do I cancel the delete? Thowing an exception seems to cancel it, but is that the way to do it? And how do I display a custom error message to the user? I don't want to show the generic "Not all selected items were processed. It may depend on system restrictions or security settings."