Simplify sharing of opportunities (Or any entities) with direct e-mailing links

One thing I found useful when working with MSCRM is the possibility to directly access
records by hitting its direct URL. Out-of-the-box this can be manually done by
opening a record and hit CTRL-N or CTRL –D. Later copy the URL and past it to
your e-mail. Whoa I love CTRL-C. Well by adding below script to your onload you
will have a new ready to email link in your right corner of the record.

Fast access to direct record, sharing, etc

Useful for testing

Could be extended with url copied to clipboard

Feel free to rewrite script in an iframe for support. See this script as an idea.

NOTE! Customizations directly to the DOM are not supported by the product group.

Notice new link in right corner of entity! Click the E-mail opportunity link to
open outlook with direct URL pasted to e-mail

function createSendLink()

{

var strUrl = "";

if (IsOnline())

{

var title = "Please followup on Opportunity ["
+ crmForm.name.DataValue + "]";

var id = crmForm.ObjectId;

id = id.replace("{",""); id =

id.replace("}","");

query
= '' + this.location;

query
= query.substring(0, query.indexOf('?'));

strUrl
= query + "/sfa/opps/edit.aspx?id=";

}

if (IsOutlookLaptopClient())

strUrl
= crmRcUtil.ServerUrl.replace("MSCRMServices", "") +
"sfa/opps/edit.aspx?id=";

strUrl
= escape(strUrl);

var a = document.createElement("a")

var aText = document.createTextNode("E-mail
opportunity link...")

a.href
= "mailto:&subject="+title+"&body=" + strUrl + id;

a.name
= "EmailLink";

a.appendChild(aText)

if
(document.getElementById('_MBcrmFormSubmitCrmForm1truetruefalse')!= null)

{

var cur =
document.getElementById('_MBcrmFormSubmitCrmForm1truetruefalse')

document.getElementById('mnuTitle').insertBefore(a,
cur.nextSibling);

}

}