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
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