You need to sign in to do that
Don't have an account?
Ross Gilbert 18
Code review on trigger that prevents record insertion
This trigger simply prevents a user from inserting a record on an object. It's not bulkified since the whole point is to prevent any record from being inserted at all. It works fine but I wanted to check with the community to see if anyone sees anything wrong with the code or if it might be improved:
trigger FeedItemTrigger on FeedItem(Before Insert){ /*Ross Gilbert 6/9/2015: The following prevents a Salesforce user from inserting any new Feed Item object in Salesforce*/ for(FeedItem fi: trigger.new){ fi.addError('Chatter is not currently supported for Salesforce. You are not allowed to create new chatter posts or comments at this time.'); } }What do you think?
everything looks to be fine with the code but what if a user wants to comment on a already existing feeditem. I guess to restrict people even from commenting use the same snippet of code for feedcomment also.