locked
Getting Error on getting Serverurl RRS feed

  • Question

  • Hi Experts,

    i am getting on error when try to get the Serverurl through script object.

    Below is my Code:

     ScriptObject xrm = (ScriptObject)HtmlPage.Window.GetProperty("Xrm");
                    ScriptObject page = (ScriptObject)xrm.GetProperty("Page");
                    crmPage = page;

    Can you please tell me what is the reason that xrm is returning null;

    But I added same thing in another application ,it is returning some value.

    Tuesday, December 4, 2012 10:44 AM

Answers

  • I fixed this by Following the below link:

    http://msdn.microsoft.com/en-us/library/gg328541.aspx

    and added <script type="text/javascript" src="ClientGlobalContext.js.aspx"></script> in page

    Thank you

    • Marked as answer by Ashis_K Tuesday, December 4, 2012 12:57 PM
    Tuesday, December 4, 2012 12:56 PM

All replies

  • Hi,

    Please include the ClientGlobalContext.js.aspx in your page.

    http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/86637265-65e0-4f8b-a83f-31d917de6f0c


    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful !!!
    Vikram !

    Tuesday, December 4, 2012 11:25 AM
  • Hi _Vikram,

    I have written also <script type="text/javascript" src="../ClientGlobalContext.js.aspx"></script>.

    But It was showing error

    But I just added like 

    <script type="text/javascript" src="/TRAINING01/WebResources/ClientGlobalContext.js.aspx"></script>

    It is working fine.

    but my Question is why it is not running on first condition.

    how can i generalized this,because if will use the second one it is supposing like hard coded stuff.

    So give some suggestion ...

    Tuesday, December 4, 2012 11:49 AM
  • I fixed this by Following the below link:

    http://msdn.microsoft.com/en-us/library/gg328541.aspx

    and added <script type="text/javascript" src="ClientGlobalContext.js.aspx"></script> in page

    Thank you

    • Marked as answer by Ashis_K Tuesday, December 4, 2012 12:57 PM
    Tuesday, December 4, 2012 12:56 PM