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
Anil MeghnathiAnil Meghnathi 

Trigger is not fired while posting through Chatter Desktop

While i am posting any thing through Chatter Desktop,Trigger on FeedItem is not fired.

 

Any Idea??

How to fire that trigger???

 

 

Thanks

 

Anil

Best Answer chosen by Admin (Salesforce Developers) 
Jia HuJia Hu

When posting through Chatter desktop, you code does work. It fired and stopped the posting, but just no error message pop-up window.

All Answers

Jia HuJia Hu

My FeedItem Trigger fired for the UserFeed through Chatter Desktop,...

Will you please share your code?

Anil MeghnathiAnil Meghnathi

Thanks

 

trigger ChatterMonitorKeywordFilterOnPost on FeedItem (before insert,after insert) 
{
    FeedItem[] f1 = Trigger.new;
    User u;
    u=[select Id,IsBlocked__c from User where id=:UserInfo.getUserId()];         
    if(u.IsBlocked__c==true)
    {
                 f1[0].adderror('You are Blocked by Your Moderator');
    }    

}

 

 

 

This is the code of trigger which is fired when user post from login in org.But not fired when post through Chatter Desktop.

 

Please suggest me.

Anil

Jia HuJia Hu

When posting through Chatter desktop, you code does work. It fired and stopped the posting, but just no error message pop-up window.

This was selected as the best answer
Anil MeghnathiAnil Meghnathi

Thanks a lot.

 

Thats great.

So do you have any idea how to show that error message in chatter desktop???

 

Anil