+ Start a Discussion

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? 


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.