web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

How to add validation before default “Close as Won” action in Opportunity (Model-Driven App)

(0) ShareShare
ReportReport
Posted on by 42

Hi Team,

I am working in a Model-Driven App in Microsoft Dynamics 365 Sales.

I need to implement custom validation before the default “Close as Won” action executes on the Opportunity form.

 

Requirement:

• When the user clicks “Close as Won”

• If a specific field (e.g., currentsituation) is empty

 → Show a form notification and prevent the Close as Won dialog from opening

• If the field is populated

 → Allow the default Microsoft Close as Won dialog to open normally

 

What I tried:

  1. Used Ribbon Workbench (Classic)
  2. Created a custom command
  3. Added a JavaScript action for validation
  4. Attempted to call the default command (Mscrm.Form.opportunity.CloseAsWon) via:
  • CommandCore
  • Reference Action
  • XrmCore.Commands.CommandManager.executeCommand

However:

• CommandCore keeps reverting

• Reference Action option is not available

XrmCore is undefined in Unified Interface

• JavaScript either doesn’t trigger or default command does not execute.

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 50 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 49

#3
Fiona_Tiernan Profile Picture

Fiona_Tiernan 22 Moderator

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans