locked
trim URL in mscrm 2011 RRS feed

  • Question

  • Hi ,

    I have written a Jscript inside the Ribbon button of Account to generating the URL.
    My code and URL  is working fine in IE 9 when I'm clicking the button but when I'm using IE 10 I'm getting spaces in between Value and Name.

    Please find the below code for the same.

    getAccountRibbon = function(AccId) {
        LoadWebResource("jscript/5.4/library.js");
      
        getURL = FetchSingleValue("new_details", "new_root", "new_name", "Ribbon_URL", false);
        AcountUID = AccountId.replace("{", "").replace("}", "");
        Value = FetchSingleValue("account", "new_value", "accountid", AcountUID, false);
        AcName = FetchSingleValue("account", "address1_name", "accountid", AcountUID, false);
        UrlParam = URIComponent(AcName );
        URL = getURL + "Val=" +Value+"&NAME=" + UrlParam ;
        window.open(URL);

    }

    Thanks,


    Thanks, Toushu

    Wednesday, December 11, 2013 1:09 PM

All replies

  • Hi,

    If you are looking to open crm entity form its better to use following method instead of window.open().

    http://sliong.wordpress.com/2012/11/07/crm-2011-open-entity-form-with-xrm-utility/


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !!!
    Vikram Singh. !!!  My Blog

    Wednesday, December 11, 2013 1:34 PM
  • Virkram,

    Thank you very much for your response,

    I have resolved the issue by changing the Jscript

    UrlValueParam = URIComponent(Value);
    URL = getURL + "Val=" + UrlValueParam +"&NAME=" + UrlParam ;
    window.open(URL);

    its working fine now.. URL is generating as expected.

    Thanks,


    Thanks, Toushu

    Thursday, December 12, 2013 11:53 AM
  • Hi Rahul,

    Window.open may cause issue for users using outlook client. Opening a web resource or record in a new window from the Outlook client may cause the user to see a login prompt rather than expected record.. JavaScript's window.open() have this issue because in Outlook user is authenticated using MAPI calls to the server. The way Outlook openes up CRM forms in a new window is different.

    You can use supported methods as suggested by vikram.

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

    HTH!

    Thanks!

    Thursday, December 12, 2013 5:28 PM
  • Thanks Kalim,

    I will do the changes accordingly as suggested my Vikram .

    Window.Open();

    Thanks,


    Thanks, Toushu

    Friday, December 13, 2013 7:08 PM