locked
HELP SDK CRM 2011 RRS feed

  • Question

  • HI,

    In the class "CrmServiceHelpers" SDK, this class handles the connection to the CRM , here I connect to a CRM ONLINE but in the console I indicates the number of oganisation that I accessed.

    So what I want now is to find the piece of code to modify in order to write such Organization name = "Contoso" in the code directly without having to specify the number to the console.

    Someone has the solution?

    Thanks'

    Thursday, May 31, 2012 1:28 PM

Answers

  • Without additional code refactoring you might likely do it in the GetOrganizationAddress method. 

    Look up "if (orgs.Count > 0)" line in that method, and, then, replace everything inside that "if" with 

    config.OrganizationName = "MyOrganization"

    return new System.Uri(<organization_url>);

    Or, if you know organization id (the one that you enter in the console), you might replace 

    String input = Console.ReadLine();

    with 

    String input = "<your_id_number>";

    in the same method


    Alex Shlega, GotchaHunter.Net

    • Marked as answer by Jalix60 Thursday, May 31, 2012 3:44 PM
    Thursday, May 31, 2012 2:58 PM

All replies

  • you can add the organization service name in a app.config  file of console application and use this setting to set organization name.

    Atenciosamente,
    Rodrigo Hentz - MCP.MCPS.MCNPS.MCTS.MBSS.MBSP.MCITP
    Profile
    Blog


    Thursday, May 31, 2012 1:34 PM
  • Yes but in the code of the class "CrmServiceHelpers" where i can specify the name of The OrganizationName , like this OrganizationName = "MyOrganization" for example ?
    Thursday, May 31, 2012 1:39 PM
  • Without additional code refactoring you might likely do it in the GetOrganizationAddress method. 

    Look up "if (orgs.Count > 0)" line in that method, and, then, replace everything inside that "if" with 

    config.OrganizationName = "MyOrganization"

    return new System.Uri(<organization_url>);

    Or, if you know organization id (the one that you enter in the console), you might replace 

    String input = Console.ReadLine();

    with 

    String input = "<your_id_number>";

    in the same method


    Alex Shlega, GotchaHunter.Net

    • Marked as answer by Jalix60 Thursday, May 31, 2012 3:44 PM
    Thursday, May 31, 2012 2:58 PM