I would like to Delete casefeed whenever a email message is deleted. Current if I delete email message the mail record is getting deleted but still the case feed displaying in casefeed. (I Dont want to delete all the feeds Only perticular feeds need to be deleted.)
2 Answers
You could query FeedItem record based on Parent Id and delete that
delete ([SELECT Id FROM FeedItem
WHERE ParentId =: <your email record Id>]);
-
-
-
-
-
ParentId Refered to case and not with email does it really work? strange..! May 31, 2019 at 7:00
The issue is i deleted email message from trigger instead of this I called future method to delete emailmessage so feed also getting deleted