Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How do you initiate the close Opportunity dialogue with JavaScript, from a view?

Posted on by 110

Hi all,

I have created a custom button on a view using ribbon workbench. The button displays a custom web resource and takes user input before updating a field. 

Once this is complete, I would like to open the standard Opportunity close as won dialogue box. I can achieve this using the below code whilst I am in the Opportunity form.

Mscrm.OpportunityCommandActions.opportunityClose(1);

This won't work from a view though... I've tried copying the method from the existing button and passing the same parameters but nothing happens. Has anyone else done this before?

function showAlert(crmParam, itemRef , boolParam , selControl) { Mscrm.OpportunityGridCommandActions.opportunityClose(itemRef , boolParam , selControl); }


My button:

30463010.Capture.PNG
Standard out of box button:
5315.Capture2.PNG


Thanks in advance

*This post is locked for comments

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans