function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ted.TsungTed.Tsung 

NoteAndAttachment

Can you change the OwnerId of a "NoteAndAttachment" record? We have a use case where once an attachmen has been added the "del" option must be disabled. Is this possible via any API call?
werewolfwerewolf
NoteAndAttachment is a derived object that comes from the Note object and the Attachment object.  You can change the owner of the Note or the owner of the Attachment through those objects and your changes will be reflected on NoteAndAttachment, but you can't change the NoteAndAttachment object itself.
Ted.TsungTed.Tsung
Thank for the answer..BTW, is there a way to setup Note and Attachment so that a user can read it but can not delete it?


werewolfwerewolf
Notes and Attachments' editability are controlled by the CRUD of the parent object.  So on Opportunity, for example -- if your profile has Update permissions on Opportunity then you can read, edit and delete notes and attachments.  Alternately, if you have a private sharing model and the Opportunity is shared to these users as Read Only then you'll achieve the same effect.
Ted.TsungTed.Tsung
in financial service vertical, there is a unique requirement where after a note or attachment has been added and reviewed by the compliance officer, it can not be edited or deleted. Is there a way to accomplish this requirement via the current note and attachment configuration in SFDC?
 
Thanks for your earlier reply
werewolfwerewolf
Attachments are apex-triggerable, if I'm not mistaken, so I believe you can put before update and before delete triggers on those that keep certain people from deleting them or changing them.
 
Notes I'm not sure about.  If they're Apex triggerable then you can do the same with them, but if not then there's not too much you can do short of setting the read-only-ness of them or replacing them with a custom Notes object where you have more control.