Knowledge Center

15 Mar, 2022

How to Trigger Plugin when Opportunity is won?

Posted on 15 Mar, 2022 by Admin, Posted in Dynamics 365 Dynamics-365 Sales

How to Trigger Plugin when Opportunity is won? Blogs

How to Trigger Plugin when Opportunity is won?


Recently, we had a requirement to update a field on opportunity record whenever an opportunity was closed as won.

My first thought was that it was pretty straightforward and registered the plugin using this step:

  • Message – Update
  • Primary Entity – opportunity

But it did not fire the plugin when opportunity was closed as won, and I was thinking why?


After a bit of research I found that I instead needed to use the following:

  • Message – Win
  • Primary Entity – opportunity

But this does not return opportunity as “Target” as you might think, it actually returns “Status” and “OpportunityClose” .

OpportunityClose contains the information listed on the form displayed when you try to Win/Lose an Opportunity, CRM stores this as a separate entity.

As you can see we can get opportunintyid from the entity.

We can use it retrieve the opportunity record and perform desired operation on it.


This is a Required Field


Recent Updates

11 Jun, 2024

How to create a routing rule set to route cases in Dynamics 365

In this blog we will discuss how to create a routing rule to automatically route the cases to queue in…

06 Jun, 2024

Restoring Deleted Records in Dataverse Tables

In this blog post, I will be discussing how we can restore the deleted records from any table in Dataverse.…

15 May, 2024

Associated Grid Control Component in Dataverse

The Associated Grid Control enables us to improve the simplicity and readability of forms by displaying related record details across…