+ Start a Discussion

How to test a change on the status (Chatter) of a user ?


in a test class I need to test some trigger when the user changes his Chatter status (What are you working on ?) but i don't know which field i have to use.

If i export the User fields, i find the status in the CurrentStatus field, but apparently i can't set the value of the field in my test class.


I simply do :

usr.currentstatus = 'bla bla bla';
update usr;

 but i get the error "Invalid field currentstatus for SObject User".


Anyone an idea ?


Thanks for the help



No longer available in API 25.0. Downgrade to a lower API version, or simply post a new FeedItem with the ParentId set to the user's ID.


I think he wants it triggered when the User changes that field, not change the field in the trigger.


But yeah, that's the right place. Can you put a trigger on FeedItem?


the whole story is I want to be warned when people install mobile apps or Chatter Desktop.

So i checked where this is stored and either in the User status or in a FeedItem.

So i've 2 triggers and one is on the User status but i don't know how to make the Test class for this one as i can't set the value of the status.


by putting the trigger only on the feeditem, i won't see all the install.