
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:
Mscrm.Form.opportunity.CloseAsWon) via: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.