Whenever an update happens in Salesforce from a third party system, we have to make sure that we don't fire the platform events and to ensure that we have a checkbox in place which is set to true by the third-party system. So, once the checkbox is true, we can prevent the platform events from firing in after trigger, but to make sure that the platform events fire for any other next transaction we'll have to uncheck the checkbox as well. I am just confused if it's possible to set the checkbox in the same transaction which was triggered by the third party system and that too in after trigger.
I was thinking of a future method, but then again there are chances that I might miss some updates on that particular record till the time future is fired to disable the checkbox. Am I missing something?
Any help is appreciated!