2

I have enabled Notes from "Note Settings" and am using them with Accounts

I understand that access to notes is controlled by access to the associated object/record, and sharing settings for the note.

However, I am assume it's not possible to prevent them from deleting their own notes after they are created correct? Or am I missing something, there are not "Note Specific" Permissions defined on the profiles?

Is this true?

Thanks

3

One cannot independently permission (Content) Notes. To prevent deletion, I think you'll have to go to an Apex trigger to add an error on the before delete event.

A very quick example of how to do this would be:

trigger NoteTrigger on ContentDocument (before delete) {
    for (ContentDocument c : Trigger.new) {
        if (c.FileType == 'SNOTE') {
            c.addError('You cannot delete a Note');
        }
    }
}

Of course, this will prevent everyone, including System Administrators, from deleting all Notes, so it's probably not what you want exactly but you can add business logic around such a mechanism.

In a real trigger, I would want, at minimum, to provide a Custom Setting or Custom Permission-based exclusion so that you could selectively permit the deletion of Notes.

| improve this answer | |
  • Thanks @David Reed that was my first suggestion when discussing this with colleagues but again - as you stated it has its issues. – jordan.baucke Feb 8 '19 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.