Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger notetrigger on Note (before update) { for(Note n: trigger.new){ n.addError('No edit allowed'); } }
trigger notetrigger on attachment (before update) { for(attachment n: trigger.new){ n.addError('No edit allowed'); } }
trigger notetrigger on Note (before update) { Id profileId=userinfo.getProfileId(); String profileName=[Select Id,Name from Profile where Id=:profileId].Name; if(profileName!='System Administrator'){ for(Note n: trigger.new){ n.addError('No edit allowed'); } } }
trigger notetrigger on Note (before update) { Profile p=[Select Id from Profile where name='System Administrator')]; for(Note n: trigger.new){ if(p.id!=userinfo.getProfileId()) n.addError('No edit allowed'); } }
for Notes
for attachment
My Req. is System admin will edit or delete attachment File but Ohter user can only view these Notes and attachment.
You can try this code:
let me know if it helps
Thanks!