Deleting images in Dynamics 365 should be simple, right?
Well, not it is not always as simple as it should be.
Recently, I had a requirement to allow image deletion in a controlled way—not just a free-for-all delete-fest. Naturally, my first thought was security roles or column security profiles. But no dice.
Our developer, brimming with enthusiasm, was all set to unleash JavaScript. But as anyone who's ever inherited a CRM system knows, JavaScript solutions can age about as well as unrefrigerated seafood. I prefer solutions that are robust and maintainable, even after the original developer has vanished into the ether.
So, a few minutes of strategic thinking later, I had a perfect, fully supported, and JavaScript-free solution! We added a simple slider that triggered a Power Automate flow to delete the photo and reset the slider—clean, controlled,supported and no rogue scripts lurking in the background. This also meant that auditing - another out of the box feature of Microsoft Dynamics 365 - could tell us exactly who was uploading the incorrect photos!
The best part? The team responsible for deleting images uses a different app than those uploading them, so access control was naturally built in.
A win for logic, maintainability, and my ongoing mission to reduce unnecessary JavaScript in the world.