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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create custom close opportunity

(0) ShareShare
ReportReport
Posted on by 815

Hi,

I have imported Ribbon Bench and able to create button as "Close Opportunity". I just want to know how to link custom web page or Workflow to close opportunity to "Button".

Rule is : When clicked on Close Opportunity button and should ask info to enter and close, this can be do through java script. if yes, please let me know how to write code.

Can you please share steps to do it ?

Regards

Faisal

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    If you want to capture some quick data from user, you can create a html webresource where you have have your html fields and there you can use JavaScript WebAPI call to close opportunity.

    Otherwise you can directly call your JS method from ribbon button.

    You can use this sample code in your html page to close it.

    community.dynamics.com/.../how-to-close-opportunity-as-won-using-webapi

    You can use parent.Xrm to refer context to get server URL and other details

  • Verified answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    Another way is just duplicate the close opportunity button and create a new button. On click of that button you can call your custom web resource ( can be html) through javascript and work as you wish.

    Following link may help you to call any web resource from ribbon button:

    msdn.microsoft.com/.../jj602956.aspx;MSPPError=-2147217396#BKMK_OpenWebResource

    To create ribbon button you can use Ribbon workbench. Download it from below:

    www.develop1.net/.../ribbonworkbench.aspx

    Hope this helps:)

  • Syed_Faisal Profile Picture
    815 on at

    I have created button and now need to create html page.

    I can create html page but not sure how to link javascript, can use rest builder ?

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    you can refer to below post on how to use javascript in html.

    arunpotti.wordpress.com/.../html-webresource-example-in-crm

    use webapi to close opportunity

    community.dynamics.com/.../how-to-close-opportunity-as-won-using-webapi

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Yes, you can use rest in html page, please refer examples in my blog for example this one: http://himbap.com/blog/?p=911 where REST is used, this is for older version but will give you idea how to use REST over html web resource.

  • Verified answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    Yes you can use Rest Builder and create request there. Following links may help you further:

    arunpotti.wordpress.com/.../html-webresource-example-in-crm

    mahenderpal.wordpress.com/.../html-web-resource-in-ms-crm-2011

    Hope this helps:)

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans