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
cedgcedg 

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

Hi,

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

Ced

sfdcfoxsfdcfox

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.

craigmhcraigmh

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?

cedgcedg

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.

 

Ced