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

This is a Required Field

Loading

Recent Updates

Blogs
12 May, 2025

How to create an Autonomous Agent in Copilot Studio

What Are Autonomous Agents in Copilot Studio? Autonomous agents are AI-driven entities that operate independently within Copilot Studio. They go…

READ MORE
Thumbnail D365 Sales
Blogs
09 Apr, 2025

What Is Dynamics 365 Sales? A Comprehensive Guide

What Is Dynamics 365 Sales? A Comprehensive Guide Microsoft has become a leader in business applications with its suite of…

READ MORE
Blogs
02 Apr, 2025

Quality is not just an option; it’s a responsibility

In the world of software development, testing is often seen as an optional phase, especially when there is no dedicated…

READ MORE