MS CRM Add a button/link to open new browser window from form

If you want to place a button on a CRM form without using the isv.config file you can do so by javascript. This examples will take a dummy attribute field and make it look and act as a button by calling a javascript function with the onclick event. Place the code below in the onLoad event of your CRM form. In this example the name och city fields are passed as search arguments to an external website.

//make a field look and act like a button = “center”;
crmForm.all.stockexchange.vAlign = “middle”; = “hand”; = “#CADFFC”; = “#000000”; = “#330066”; = “bold”;

crmForm.all.stockexchange.DataValue = “Sök bolag”;
crmForm.all.stockexchange.attachEvent(“onclick”, SearchAllaBolag);

function SearchAllaBolag()

  //Get values from form
  if ( != null)
    var what = escape(;   
    var url = ‘’ + what

    if (crmForm.all.address1_city.DataValue != null)
      var where  = escape(crmForm.all.address1_city.DataValue);
      url += ‘&where=’ + where;

    //open browser window
    alert(Name is missing.’);

Credits to

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s