Welcome to MSDN Blogs Sign in | Join | Help

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);

    }                    

    }

     

     

    Published Thursday, April 19, 2007 1:54 PM by Jonas Deibe
    Filed under: ,
  • Comments

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

    I have copied you code and pasted it directly into on Onload event, but it is not doing anything.  Not even an error when the form loads.  I have published it and it is also enabled.  Do you have any ideas?

    Thanks,

    Chris

    Thursday, November 29, 2007 1:15 AM by Chris Brown

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

    Please call the function createSendLink() somewhere in onload and it will work

    ... copy and past code above ...

    and add this line

    createSendLink();

    Thursday, November 29, 2007 3:34 AM by Jonas Deibe

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

    I have copied you code and pasted it directly into on Onload event, but it is not doing anything.  Not even an error when the form loads.  I have published it and it is also enabled.  Do you have any ideas?

    Monday, March 31, 2008 4:25 AM by crul

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

    Have you tried it on the opportunity entity? I just verified and it works fine on my CRM 3.0 system.

    Monday, March 31, 2008 4:51 AM by Jonas Deibe

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

    Hi there,

    Do you have a solution like this that works for CRM 4.0? I cannot get this version to run.

    I suspect the Elements have changed name in the new release.

    eg "_MBcrmFormSubmitCrmForm1truetruefalse"

    Any ideas? I would love to get this working on CRM 4.0

    Cheers

     

    Email direct links are on form in CRM 4.0 so there is no need for this CRM 3.0 functionality

    Friday, April 11, 2008 3:54 PM by meadx
    Anonymous comments are disabled
     
    Page view tracker