You need to sign in to do that
Don't have an account?
mirarun
Is there a way to override SHARE button ?
Hello folks,
Is there a way to override the 'Share' button on the chatter window ? Im trying to find a way to enable chatter for our Org and make it available for only certain profiles. Looks like there is no straight forward way to do this. This being the case, if I can override the share button or if I can find a way to write a trigger on 'SHARE' , I can display user friendly warnings to the profiles that are not allowed to use Chatter.
Appreciate your thoughts folks.
This will not execute a FeedItem trigger because, when adding a post from your User's home page you are actually updating the user status which exists on the User object. You could add a trigger to the User object and check for changes on User.userStatus.
All Answers
You can not currently override the share button, but as of Spring 11 you can write triggers on feed items which should be able to achieve the functionality you are looking for.
Thanks for the response cloudcoder. But if I understand correctly, the trigger on FeedItem gets executed only upon a change in the feed tracking ? I tried and the new FeedItem trigger is not getting executed when a post is shared. Thoughts ?
CloudCoder, to add: Im expecting the trigger to fire when someone text is posted on the chatter window in the home page.
Yes you can add a trigger on before insert for example, and use the addError message to return an error message to the user. eg,
Hi cloudcoder
I am having a trigger on FeedItem Insert. I am able to test it and it works fine. Now i am having hard time to write the test coverage for this trigger. I tried to insert a FeedPost with all possible feed types like "UserStatus" etc... But could not achieve anything. Can you please help me with some clues or workarounds.
Thanks
Vishnu
Can you share your trigger code, and test code? I can then respond with some pointers, suggestions
Quinton,
I'm having the same issue as mirarun. I have code that runs after insert of FeedItem...this appears to work regardless of what a user is posting against (e.g. account, contact, custom object). The only exception to that is when a user posts to his or her homepage. The trigger does not appear to fire in this case.
Would you have any insight on the issue?
Thanks,
Chris
This will not execute a FeedItem trigger because, when adding a post from your User's home page you are actually updating the user status which exists on the User object. You could add a trigger to the User object and check for changes on User.userStatus.
Thanks, Quinton. I got that to work. Much appreciated.
Thank you Quinton. It worked :)
Can you explain how u did that ?
Hey thax for reply . But still there is a problem , I want to write a simple trigger on chatter post. Whenever i will post comment on chatter, trigger should be fired. I have written a trigger on feeditem with after insert event, but my trigger is not getting fired. Can anyone help ?
Can you post your code so I can have a look and provide some feedback
Hi ,
Hey thnx , problem got solved , i was not giving parentID , that was the mistake.