Categories
Appunti

Generated new alert feed on Salesforce

snippet for generated news feed in Apex Code

List<FeedItem> FeedItemList = New List<FeedItem>();
        for (String id : recipientsIds) {
            FeedItem post = new FeedItem();
            post.ParentId = id;
            post.Title = 'test title';
            post.Body = 'body title';        
            post.LinkUrl = '/lightning/page/home';
            FeedItemList.add(post);
        }
        if (FeedItemList.size()>0) {         
                insert FeedItemList;     
        }

Leave a Reply