I have a post-operation create plugin that is triggered for the creation of a new contact. This plugin looks at a preset list of marketing lists and attempts to add the newly created contact to those preset marketing lists.
I also have a plugin that operates on the message "AddMember" during the pre-operation stage called PreventDuplicates. This plugin attempts to retrieve the contact record based on the contactid (entityid) passed in because it needs more attribute information regarding the contact (especially the ownerid). PreventDuplicates verifies there are no other contacts in the specified marketing list that has the same email address and is owned by the same owner.
The problem I am running into is that the PreventDuplicates plugin is reporting back "contact With Id = xxxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxx Does Not Exist". It seems like during the Post-operation phase of a Create message, the record hasn't yet been committed to the database. I would appreciate if anyone has a suggestion on how to alleviate this problem.
Thanks David, that was what I was missing. Changing my post-operation plugin to process asynchronously resolved my issue.
In a synchronous post-operation plugin step, any changes are still part of the original transaction. Try registering the post-operation create step to run asynchronously
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,802 Super User 2024 Season 2
Martin Dráb 229,129 Most Valuable Professional
nmaenpaa 101,154