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
vibrationvibration 

How to retun a list valuea in single chatter feed using chatter?

How to retun a list valuea in single chatter feed using chatter?

 

I have 5 note records. when i insert a 6th value, all 6 value in display in single chatter feed. now it displayed in 6 chatter feed.

 

my code

 

 List<FeedItem> feedItems = new List<FeedItem>();  
   
    
     List<Opportunity> lstOpportunity= [select name,id from Opportunity];

 

  for (note Trinote : Trigger.new) {      
        for(Opportunity opp: lstOpportunity){    
          List<Note> lstnote=[select Body,Title,ParentId,OwnerId from note where ParentId=:Opp.id ];                  
          for(integer i = 0; i < lstnote.Size(); i++) {   
         FeedItem fitem = new FeedItem();
         // fitem.ParentId = opp.id;
          // fitem.LinkUrl = '/' + Trinote.id; //This is the url to take the user to the note
          fitem.Body =  + '\nTitle :' + lstnote[i].Title
                        + '\nBody :'  + lstnote[i].Body
                        + '\nOpportunity name :' + opp.name;
              feedItems.add(fitem) ;                      
                }

 

if (feedItems.size() > 0) {
        Database.insert(feedItems); //notice the false value. This will allow some to fail if Chatter isn't available on that object
    }

kodeXkodeX

What do you mean by?

"... all 6 value in display in single chatter feed. now it displayed in 6 chatter feed.""

 

And yet another unique puzzling piece on the last line,

"This will allow some to fail if Chatter isn't available on that object"

Who are "some"?

 

Rephrase your question!!!!!!!!!