locked
Problem with .getOrgUniqueName() in Office365 RRS feed

  • Question

  • Hi,

    I'm having a problem with the client side getOrgUniqueName() method. The organization is created from the Office 365 portal and uses ADFS integration.

    The problem is that the method does not return the name of the organization as shown in the address bar (and also return by .GetClientUrl() for example), but instead it returns the temporary name that was initially assigned by the Office 365 CRM management tool. I didn't create the organization but from what I was told it was first assigned a temporary name = {company_name}0 and then it was possible to rename it what it is called now.

    Example:

    The org was created initally as supercompany0

    Then it was renamed to supercompanytest - and this is what the address is https://supercompanytest.crm4.dynamics.com

    But the .getOrgUniqueName() method returns "supercompany0" instead.

    I probably could use the .getClientUrl() method and do some string replacements to get the org name, but that doesn't seem like a very stable and professional solution.

    Has someone else encountered this issue and solved it?

    Thanks!
    Łukasz


    • Edited by kowgli Thursday, March 28, 2013 12:10 PM
    Thursday, March 28, 2013 10:04 AM

Answers

  • Hi,
    unfortunately the getOrUniqueName function inside CRM online environments sometimes returns "strange" values (as your case or for example the GUID of the organization instead the name)

    As you wrote you can use the getClientUrl function, if you still need you can retrieve the name part using this javascript:

    var orgName = Xrm.Page.context.getClientUrl().split(".",1)[0].split("//",2)[1];

    I suggest also to open a ticket to Microsoft to fix this issue on your organization.


    My blog: www.crmanswers.net

    • Proposed as answer by Guido PreiteMVP Monday, April 1, 2013 12:10 PM
    • Marked as answer by kowgli Wednesday, April 3, 2013 9:50 PM
    Monday, April 1, 2013 12:09 PM

All replies

  • Hi,
    unfortunately the getOrUniqueName function inside CRM online environments sometimes returns "strange" values (as your case or for example the GUID of the organization instead the name)

    As you wrote you can use the getClientUrl function, if you still need you can retrieve the name part using this javascript:

    var orgName = Xrm.Page.context.getClientUrl().split(".",1)[0].split("//",2)[1];

    I suggest also to open a ticket to Microsoft to fix this issue on your organization.


    My blog: www.crmanswers.net

    • Proposed as answer by Guido PreiteMVP Monday, April 1, 2013 12:10 PM
    • Marked as answer by kowgli Wednesday, April 3, 2013 9:50 PM
    Monday, April 1, 2013 12:09 PM
  • Thanks Guido. I will do as you suggest.
    Wednesday, April 3, 2013 9:51 PM