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
srikanth challasrikanth challa 

Is there any way to send a notification to a rep in chatter when a case is created ?

Hi Guys, 

I would like to send a service notification for the sales reps in chatter when a case is created. I know that the workflow doesn't have this functionality. Is there any way to do it?

 
Best Answer chosen by srikanth challa
Rufus RodenRufus Roden
Don't about workflow but you could try a trigger
 
trigger CaseTrigger on Case (after insert) {
    
    if (Trigger.isAfter) {
        List<FeedItem> items = new List<FeedItem>();

        for (Case c: Trigger.newMap.values()) {
            items.add(new FeedItem(
                parentId = c.ownerId,
                body = 'your message'
            ));
        }
        
        insert items;
    }
     
}