+ Start a Discussion
Damien_Damien_ 

Post Chatter message to new user

When I create a new User, is there a way I can have a default Chatter message when they go to their Chatter page?

Best Answer chosen by Admin (Salesforce Developers) 
Damien_Damien_

Apparently to post as one User to another User, you change the CreatedById.... Kinda foolish since usually this is a read only field.

All Answers

saasforcesaasforce

Hi Damien,

     You can create an after insert trigger on User. In this trigger insert a feed item with the following attributes:

           Body=Default message

          parent id=user id.

 

     Hope it helps.

 

Thanks and Regards

Siva

Damien_Damien_

That was actually the first thing I looked into and it gives an error.  

 

Instead, I put it into another class as a static method with the @future annotation.  This worked.  I still wonder if there is any other way to do it without a trigger also.

Damien_Damien_

Apparently to post as one User to another User, you change the CreatedById.... Kinda foolish since usually this is a read only field.

This was selected as the best answer