Skip to main content
deleted 20 characters in body
Source Link
Rao
  • 16.8k
  • 13
  • 69
  • 108

There may be a simpler method, but this is what I was able to come up withhave for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

Refer this doc for different types of feeditem:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feeditem.htm

You can throw a validation at the top of the page

enter image description here

There may be a simpler method, but this is what I was able to come up with for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

You can throw a validation at the top of the page

enter image description here

There may be a simpler method, but this is what I have for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

Refer this doc for different types of feeditem:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feeditem.htm

You can throw a validation at the top of the page

enter image description here

deleted 4 characters in body
Source Link
Rao
  • 16.8k
  • 13
  • 69
  • 108

There may be a simpler method, but this is what I can was able to come up with for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

You can throw a validation at the top of the page

enter image description here

There may be a simpler method, but this is what I can was able to come up with for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

You can throw a validation at the top of the page

enter image description here

There may be a simpler method, but this is what I was able to come up with for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

You can throw a validation at the top of the page

enter image description here

Source Link
Rao
  • 16.8k
  • 13
  • 69
  • 108

There may be a simpler method, but this is what I can was able to come up with for now.

Write a trigger on FeedItem on before delete and stop selected users from deleting a note:

trigger feedtrigger on FeedItem (before delete) {
    for(FeedItem  fed: Trigger.Old){
        if(fed.type == 'Contentpost'){
            //Do further checks based on profile/role/Id etc and restrict the user from deleting the note.
            fed.adderror('You cannot delete the note');
        }
    }
}

Note: You can add/ adjust type and prevent users from deleting Links, poll etc..

You can throw a validation at the top of the page

enter image description here