Quantcast
Channel: Active questions tagged chatter-feed - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 192

Wants to add @mention of the owner name of the case of chatter feed when a new case is created

$
0
0

I have created a trigger and it works without @mention. But I need the owner name of the case on the body of the chatter post.

trigger CasePostFeed on Case (after insert) {    system.debug('POST STARTED');    List <Case> caselistToUpdate = new List<Case>();    for(Case ca: trigger.new) {        FeedItem FI = new FeedItem();        system.debug('CASE ID CREATED 1 '+ ca.Id);         if(ca.Status == 'New'&& ca.RecordTypeId == '0120M000000ATBC') {            system.debug('CASE ID CREATED 2 '+ ca.Id);             FI.CreatedById ='00530000007mCQD';            FI.ParentId = ca.Id;            FI.Body = 'HI @'+ca.Owner_Name__c+'\n'+'\n'+ ca.Subject +'\n'+ ca.Contact_Name_for_Chatter__c  +' from '+ca.Account_Name_for_Chatter__c +' has submitted a new case.'+'\n'+'You can find the Case on your Trainee Management dashboard or you can get to it from this post.';            system.debug('POST CREATED');            insert FI;        }    }

Viewing all articles
Browse latest Browse all 192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>