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
Andrea mAndrea m 

Unable to access FeedItems from User trigger in test method context

Hi,
We have a trigger on User to keep track of UserStatus posts, it worked ok until we updated the metadata api to version 24.0.
The documentation says that from version 24.0 and later, test methods don’t have access by default to pre-existing data in the organization  .
Now in testing context, when we query FeedItems inside our trigger on User "after update"   we can not find in the database the records although we have just updated the user currentStatus.
We had to add the "@isTest(SeeAllData=true)" annotation to the test in order to access the data created during the test method execution.
Perhaps I disregard something, but I don't think adding the annotation shouldn't be necessary in that context.

So our conclusion is that though we created the records inside the test context when we are executing the user trigger the platform thinks of this records as org pre-existing data.

Did anyone else run into this issue?

 

thanks in advance.