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
Chandra Kant BaghelChandra Kant Baghel 

Lightning Notification not generating for tagged user when CreatedById of feedItem is changed

Hi All,
We are facing a scenario where the lightning notification is not generating for the tagged user when it is tagged in a feedItem i.e. post and the createdById of that feedItem is changed in before trigger.
 
Any pointers to overcome this?
 
Thanks
SwethaSwetha (Salesforce Developers) 
HI Chandra,
Can you share a minimal reproducible code snippet so I can try in my org to suggest better? Also, does it give any error in the debug logs? Thanks
Chandra Kant BaghelChandra Kant Baghel
Hi Shweta,
Thats the issue, it does not gives any error.

Steps to reproduce:
0. In before insert trigger of feedItem : just set feedItemInstance.CreatedById = '0053o0000086xiXXXX' // this is some system admin user's id
1. Now, Just try to @mention any user while creating feedItem/ post on any object record which has chatter enabled.

Issue: @mentioned user should get the lightning notification in salesforce but there is no notification generated.
Important Note : The user Id specified in trigger should be different from the one who is actually creating the feedItem.


Let me know more information.
Thanks