locked
Scripts do not run in outlook client - Why? RRS feed

  • Question

  • Hello Everyone

    I have written few javascripts on form load of phone call activity.

    The scripts run fine in the browser, but do not run in outlook client.

    What am I missing?

    Thanks

    Tuesday, April 24, 2012 3:06 PM

Answers

  • Hi Scott

    I resolved the issue.

    I had to reinitialize the organization using the crm configuration wizard.

    Thanks

    • Marked as answer by WPF_Dev Monday, May 7, 2012 2:58 PM
    Monday, May 7, 2012 2:58 PM

All replies

  • Please share your code here.

    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, April 24, 2012 3:08 PM
    Moderator
  • Go to the system setting setting and add outlook to custom toolbar and menu:-


    Regards Faisal

    Tuesday, April 24, 2012 3:15 PM
  • Hello Everyone

    Thanks for the replies.

    Forgot to mention. I am using CRM 2011 and I do not see this setting.

    The code is very simple.

               // Restrict the Recipients to only contacts
               document.getElementById("to").setAttribute("lookuptypes", "2");
               document.getElementById("to").setAttribute("defaulttype", "2");

                 // Restrict the Regarding to only accounts
                 document.getElementById("regardingobjectid").setAttribute("lookuptypes","1")
                 document.getElementById("regardingobjectid").setAttribute("defaulttype", "1");

    What am I missing?

    Thanks

    Tuesday, April 24, 2012 3:39 PM
  • This code is working in my envoirnment but on customer field:-

    function SetCustomerLookup(){
    document.getElementById("customerid").setAttribute("lookuptypes", "2");
    // document.getElementById("customerid").setAttribute("lookuptypenames", "contact:2");
    document.getElementById("customerid").setAttribute("lookuptypeIcons", "/_imgs/ico_16_2.gif");
     document.getElementById("customerid").setAttribute("defaulttype", "2");
    }


    Regards Faisal

    Tuesday, April 24, 2012 3:52 PM
  • Hi Faisal

    Thanks for the reply.

    I understand that it is working in your environment.

    But, it does not work in my environment and just wondering what I am missing.

    Thanks

    Tuesday, April 24, 2012 4:11 PM
  • Hello Everyone

    I get the following message in outlook client. When I click yes the script runs fine.

    This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?

    Is there a way to stop this message from popping up?

    Thanks

    Monday, April 30, 2012 6:43 PM
  • Hi WPF_Dev,

    This code operates on the 'to' field of activities - is the problem that you are using the outlook form for emails/appointments? - you can't make JavaScript operate on these fields - you can only put javascript on the 'CRM Fields' screen.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 30, 2012 7:09 PM
    Answerer
  • Hi WPF_Dev,

    This message is displayed if you are accessing crm via a different url to that configured in the MSCRM_Config database. The security risk is that you have code accessing CRM (via REST or SOAP) using the registered url (found using the getServerUrl function). IE see's this as a security risk since it looks like a different server to the one that you are accessing CRM via.

    Instructions on how to make sure that the url is correct are found here : http://technet.microsoft.com/en-us/library/dd979317.aspx

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 30, 2012 7:14 PM
    Answerer
  • Hi Scott

    I am not accessing CRM other than regular url.

    I have a IFRAME on the form of a phone call activity not a email activity, which access the external link, still on the same interanet. The script runs fine when I click yes. This message does not popup when I access the CRM via IE.

    Any suggestions?

    Thanks

    Wednesday, May 2, 2012 7:49 PM
  • Hi Scott

    I have changed in the db as per the following, but I still get this message in outlook client.

    http://technet.microsoft.com/en-us/library/dd979317.aspx

    Any suggestions?

    Thanks

    Monday, May 7, 2012 2:54 PM
  • Hi Scott

    I resolved the issue.

    I had to reinitialize the organization using the crm configuration wizard.

    Thanks

    • Marked as answer by WPF_Dev Monday, May 7, 2012 2:58 PM
    Monday, May 7, 2012 2:58 PM