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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
RichardM Profile Picture

RichardM 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans