knowledgecenter-breadcrum

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?

Introduction

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?

Solution

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.

Comment

Loading

Recent Updates

Thumbnail D365 for Marketing
Blogs
16 Dec, 2024

10 Reasons Why You Need Dynamics 365 for Marketing

This blog discusses the top 10 reasons to choose Dynamics 365 for Marketing to improve your business's marketing efforts.  …

READ MORE
Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE
Thumbnail_Microsoft365 Vs D365
Blogs
12 Nov, 2024

Microsoft 365 vs Dynamics 365

This blog will help you understand the key difference between Microsoft 365 and Dynamics 365, so you can make an…

READ MORE