You need to sign in to do that
Don't have an account?
alem
post an update to a chatter group when an account field has been changed.
Does anyone know if there is a workflow rule or trigger rule I can create to post an update (that includes multiple fields) to a chatter group when an account field has been changed?
Thank you
Hi Alem,
You can create a workflow on Account object to create a post on the group of your choice when the account record is update.
I have a sample code which I wrote to create a post on the same account:
Trigger:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
List <FeedItem> chatterPostsToAdd = new List <FeedItem>() ;
for(Account e : Trigger.new){
FeedItem accountPost = new FeedItem();
accountPost.ParentID = e.Id ;
accountPost.Body = 'updated account ';
accountPost.LinkUrl = '/' + e.id ;
chatterPostsToAdd.add(accountPost);
}
System.debug(chatterPostsToAdd);
insert chatterPostsToAdd;
}
Thank you.
We tried using this code in our sandbox environment but received errors when trying to edit an account field. Is there something we need to edit or customize in your code?
Is there really no other way to form a link between updating accounts and opportunities and posting in chatter? It seems like a common request people would have.
Alem
Alem,
It would be really helpful for members to update a code where you received an error or errors in code by posting it in here.
So far, I can make a wild guess and here is a code that I had used to chatter group on change of fields in Opportunity object.
Hope it will help...
-Saw