Quantcast
Channel: Active questions tagged casefeed - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 86

How to access Owner of Parent Record of FeedItem

$
0
0

I am trying to send emails to the owners of cases when people post to the case feed. Traversing up through parent records seems to have some strange functionality:

for(FeedItem FI : FeedItems ) {
    String Name = FI.Parent.Name;  //works just fine
    ID id = FI.Parent.OwnerID;  //returns "Variable does not exist: OwnerID"             
}

So I can go up one level to the name of the parent record, but not up another level to the owner of that record. I imagine some further querying is necessary, but I am stuck on how to do it without creating a query within a for loop (I know the query below is not in the for loop, I took it out, but trying to figure out where to go from here. Thoughts?

for(FeedItem FI : FeedItems ) {
    mapCaseIDtoFeedItem.put(FI.ParentID,FI);               
}

for(Case C : [SELECT OwnerID FROM Case WHERE Id IN: mapCaseIDtoFeedItem.keySet()]){
    ...something here?
}

Viewing all articles
Browse latest Browse all 86

Trending Articles



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