RE: Delete Attachment(Note) in Dynamics 365 Portal
Hi Hemant,
Unfortunately, It's not possible. Ideally, If anonymous user is able to create the notes so he/she should have performed other operations too. But might be due to some security implications MS has not allowed to do so.
One alternative I can suggest you that, put a button/hyperlink next to note title in order to delete the note.
Open a task entity form (in dialog/popup) on click of that link and put the Guid of the note (on which the user has clicked) in the subject field and trigger Click in order to create a new task in the CRM.
Show the message on task submission - Note Delete request has been initiated. Do this whole action by making the entity form hidden using Javascript. The user should only see the success message.
Now, as soon as a task will get created in CRM, write a plugin/custom workflow on task creation and retrieve the note by Guid (contains in the subject field) and delete the note.
Can make this process more user-friendly by putting some more efforts in JS and HTML code.
Pshedu Code:
var notguid = First write the logic to get the note guid on click of hyperlink.
$('#subject).val(noteguid);
$('#insertbutton').click();
Hope you understood.
If you find the answer as useful, please mark it as verified
Cheers
Arpit
https://arpitmscrmhunt.blogspot.in