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
Kenji775Kenji775 

Getting feedpost item id from list of user status updates

Hey all,

Here is the deal I've got going. I have a trigger, that when a user posts a new status, another type of record is created. That created record needs to store the ID of the feedpost that was created by the user posting a new status. I don't totally understand the chatter data model (it's kind of a complicated beast) but it seems as though it goes:

 

1) User posts status update (stored on user record)

2) feedpost is created (which is non querable)

3) userfeed item is created as result of feedpost, userfeed gets linked to feedpost.

 

The issue is I don't know of any reliable way to get the feedpost id from the user record (unless I query for the actual text of the post which could get very inefficient in large batches).

 

What are your guys thoughts? 

Kenji775Kenji775

Argh, it gets even more complicated. In version 22.0 it looks like the feedpostid was removed from the userfeed object, and I have no idea what replaced it, if anything.