You need to sign in to do that
Don't have an account?
Michael M
Can I set it to automatically create a chatterpost after I insert a new task via Apex?
Hello, we have some simple apex code that creates a task record, and the whoid of the task is a Lead.
My question is: Just as when a regular activity is logged, it automatically posts to chatter with a summary of the activity, I need to do the same here. Specifically, I need it to post to the chatter on the Lead record page. Can this be done?
My question is: Just as when a regular activity is logged, it automatically posts to chatter with a summary of the activity, I need to do the same here. Specifically, I need it to post to the chatter on the Lead record page. Can this be done?
You can insert chatter from Apex its Api name FeedItem, You want to post chatter on which object record pass that objects record Id in ParentId.
FeedItem post = new FeedItem();
post.ParentId = leadId;
post.Body = 'Task is created';
insert post;
I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.
Thanks and Regards,
Sachin Arora
www.sachinsf.com
All Answers
You can insert chatter from Apex its Api name FeedItem, You want to post chatter on which object record pass that objects record Id in ParentId.
FeedItem post = new FeedItem();
post.ParentId = leadId;
post.Body = 'Task is created';
insert post;
I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.
Thanks and Regards,
Sachin Arora
www.sachinsf.com