• Faiza Iqbal
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have implemented a simple integration with the help of platform events. The subscriber is an apex trigger that is working fine. And the updates from Salesforce are published in account's after update trigger. This after update trigger/ the event should be published only if the account was updated by some actual salesforce user, not with an automated process. But somehow the events are looped. The subscriber event receives an update/create a message, processes it and within 1 or 2 seconds the event is published back for the same record. I have added this check: 
//if user is automated process then it will create a recurssion
        if(UserInfo.getName() != 'Automated Process')
        {
AccountEventClass.InitializePublishEvent(newAccountList, oldMap);
        AccountEventClass.isRecurrsion = true;
}


But still, it is fired. I have deactivated the workflow rules but that did not help. Added debug logs on my AccountEventClass and on Account trigger but I don't see any logs. But still, the second party is receiving the messages back for the same records with 2 to 3 seconds.

Does anybody have any idea that how to find the process that might be triggering it? Or how to fix it? For example, the event should be published only if the account was updated by some actual salesforce user.

Many thanks!