How to Validate Close as Won on an Opportunity

potal 300x225 How to Validate Close as Won on an Opportunity

When the circumstance occurs to check when an Opportunity is Close as Won you can validate the execution of this message with a plugin using the Win message. Today’s blog will show you how to do this!

  1. First, you’ll click on the Close As Won button. This will bring up the following dialog:

080417 2048 HowtoValida1 How to Validate Close as Won on an Opportunity

You then fill out the request and a Win message will be sent to the execution pipeline.

080417 2048 HowtoValida2 How to Validate Close as Won on an Opportunity

You can write a plugin to capture the execution of this message to do any pre or post validation as needed.

080417 2048 HowtoValida3 How to Validate Close as Won on an Opportunity

The Win message contains an input parameter of OpportunityClose which you can use to obtain a reference to the Opportunity Id of the record being processed.

You may expect to register a Step using the Plugin Registration tool as ‘Won’ but it is instead a ‘Win’ as shown below.

080417 2048 HowtoValida4 How to Validate Close as Won on an Opportunity

There you have it. You can now validate the Opportunity being Close As Won and do any validation that is needed.

For more tips and tricks, make sure that you have subscribed to our blog.

Happy Dynamics 365’ing!

Let’s block ads! (Why?)

PowerObjects- Bringing Focus to Dynamics CRM