Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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."