In Dynamics 365, the Process Order functionality is often used to automate membership creation. However, in some cases, it may create duplicate membership records instead of updating existing ones.
In this blog, we will walk through a real-time solution where we modified the process and implemented a plugin to ensure existing memberships are updated instead of creating duplicates.
The user updates the Order record and clicks the Process Order button.
This button is not a simple UI action — it internally triggers a Dynamics 365 Process (Workflow).
This process is responsible for handling membership creation logic.
After clicking Process Order, a new Membership record is created.
Even when an existing membership is already linked, the system does not check it.
👉 Result: Duplicate Membership Records
The Process Order button is backed by a Workflow Process.
Inside the process, it was directly creating a Membership without validation.
✅ Solution:
A custom workflow activity plugin was created and registered.
Plugin Responsibilities:
This plugin is used inside the workflow condition.
The plugin executes a query on Membership entity using Order ID.
Based on this result, the workflow decides:
By enhancing the existing workflow and introducing a custom plugin, we successfully prevented duplicate membership creation.
This approach ensures that business logic is respected and data integrity is maintained, which is critical for CRM systems.
This solution can be reused in similar scenarios where duplicate record prevention is required.