locked
Access denied exception RRS feed

  • Question

  • Hi,

    I'm using this simple code based on a sample from SDK (CRM 2013):

    OrganizationService srv;
    Guid accountId;
    
    using (srv = new OrganizationService(connection))
    {
        Account account = new Account { Name = "Seveth Tea" };
        account.AccountCategoryCode = new OptionSetValue((int)AccountAccountCategoryCode.PreferredCustomer);
        account.CustomerTypeCode = new OptionSetValue((int)AccountCustomerTypeCode.Investor);
    
        // "Access denied" exception is thrown.
        accountId = srv.Create(account);
    
        Debug.WriteLine(account.LogicalName + " " + account.Name + " created");
    }

    When the account is being created, the app throws an "Access denied" exception. I'm able to create an account in the Internet Explorer so I don't understand what "access" is denied.

    Could anyone clarify that for me?

    Thanks,

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Tuesday, July 22, 2014 7:20 PM

All replies

  • try to do a WhoAmiRequest before create the record, in order to check that the connection is working.

    My blog: www.crmanswers.net - Rockstar 365 Profile

    Tuesday, July 22, 2014 9:11 PM
  • Hi,

    You might want to check the credentials while creating the OrganizationService proxy. Or if you're using Default Network Credentials, you might want to check the user is present in Dynamics CRM. Also check if the user has proper rights to create an account.


    Admin QuikView Solution for CRM 2013

    Wednesday, July 23, 2014 5:24 AM
  • What authentication method is configured for CRM (AD, Claims or Crm Online) ? And how is the 'connection' variable instantiated ? 

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Wednesday, July 23, 2014 9:32 PM
    Moderator