Hi Folks,
I was trying to delete unused images from Azure Blob Storage which is coming from D365 FO as a attachment.
When a new attachment is done in D365 FO, the same image will be uploaded in blob Storage. Now I want to delete the Attachment from D365 FO through code and it should automatically delete the file from Blob storage.
but it is not working. Could you please help me on this.
please let me know if some information is required from my end.
As I said, I would debug delete() method to see what's going on there. Collection information is better than guessing. By the way, I believe that enabling "Deferred deletion enabled" goes against your requirements. Again, you can see the impact of this parameter when looking into delete().
if(isExist) { ttsbegin; if(docuref.validateDelete()) { docuRef.delete(); } else { ttsabort; } ttscommit; }
Although written a class with looping for DocuRef and at last calling DocuRef.Delete().
But still it not worked than I tried to update some Document management parameters
1. Enable checkbox "Deferred deletion enabled" and update 0 in "Number of days to defer deletion"
2. Disabled checkbox "Enable Document History"
But still it is not working. Could you please let me know if I'm wrong somewhere.
I think that document management supports this feature, if enabled.
I recommend debugging DocuRef.delete() - it'll give you more information than mere "it's not working".
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156