locked
Custom button on CRM form RRS feed

  • Question

  • Hi All ,

    I need a custom button on CRM form.

    On button click , i want to open a web resource using 'Xrm.utility.Openwebresource' method.

    Request you to let me know the best and supported way to do it.

    Thanks,

    Naveen

    Monday, September 22, 2014 10:44 AM

Answers

  • Ok than use crm ribbon editor link below.

    http://crmvisualribbonedit.codeplex.com/

    After that create a button and webresource , call this webresource in your button click. In this web resource pls use the code that below. It will work..

    var customParameters = encodeURIComponent("&param1=" + param1value+ "&param2=" + param2value;
    Xrm.Utility.openWebResource("new_yourwebresourcename.html", customParameters);
    Mark as Answered or Helpful if it is helpful for you.


    Polat Aydın Crm Software Developer


    Monday, September 22, 2014 12:25 PM

All replies

  • Hi,

    Please go through post below:

    http://garethtuckercrm.com/2011/01/18/how-to-view-ribbon-definitions-in-crm-2011-3/

    Regards,

    Saad

    Monday, September 22, 2014 10:52 AM
  • It is the best way either.It also open in safari. Here you can see the below code.

    var customParameters = encodeURIComponent("&param1=" + param1value+ "&param2=" + param2value;
    Xrm.Utility.openWebResource("new_yourwebresourcename.html", customParameters);


    Polat Aydın Crm Software Developer

    Monday, September 22, 2014 10:56 AM
  • Hi Saad ,

    I need the button on form, on click of which a new page should be popped up using 'Xrm.utility.Openwebresource'

    Thanks,

    Naveen

    Monday, September 22, 2014 11:08 AM
  • Hi Polat,

    Correct ! i use similar code.

    But i need a button , on click of which this code executes.

    Thanks,

    Naveen

    Monday, September 22, 2014 11:10 AM
  • HI,

    You can use ribbon to add custom button in navigation.

    Or if you want to add custom button in form .Use HTML webresource and

    add this webresource on form.


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Monday, September 22, 2014 11:51 AM
  • Create an html page in visual studio. Add a button on this page. Add this html page as a web resource. In the form customization add this web resource onto the form by clicking add web resource button. On click of the butto put the comand 'Xrm.utility.Openwebresource' .

    Regards Faisal

    Monday, September 22, 2014 11:59 AM
  • Hi Naveen,

    PLease add a button in ribbon using the post in my answer above.

    Call the webresource from Ribbon button.

    In webresource use the following code.

    var customParameters = encodeURIComponent("&param1=" + param1value+ "&param2=" + param2value;
    Xrm.Utility.openWebResource("new_yourwebresourcename", customParameters);

    Monday, September 22, 2014 12:03 PM
  • Ok than use crm ribbon editor link below.

    http://crmvisualribbonedit.codeplex.com/

    After that create a button and webresource , call this webresource in your button click. In this web resource pls use the code that below. It will work..

    var customParameters = encodeURIComponent("&param1=" + param1value+ "&param2=" + param2value;
    Xrm.Utility.openWebResource("new_yourwebresourcename.html", customParameters);
    Mark as Answered or Helpful if it is helpful for you.


    Polat Aydın Crm Software Developer


    Monday, September 22, 2014 12:25 PM