Nachiket
Nachiket

Reputation: 640

System.Security.SecurityException In Microsoft Dynamics CRM 2013

I am developing web portal for Microsoft Dynamics CRM 2013 performing CRUD. I am facing problem while creating Account record. Account Entity have option set industry type, I am trying to set it from web portal. I have written.

    Entity account = new Entity("account");
    account["name"] = txtAccountName.Value;
    account["industrycode"] = new OptionSetValue(int.Parse(selectIndustryType.Value));
    proxy.Create(account);

I can create account record only by using name as it is mandatory. Whenever I try to create account record with option set value, CRM throwing System.Security.SecurityException exception. what could be the problem?

Upvotes: 0

Views: 1491

Answers (1)

BlueSam
BlueSam

Reputation: 1888

The SDK actually allows you to create a record without supplying all of the required fields, so that is not the issue. It sounds like the user you are connecting to CRM with doesn't have the appropriate permissions to either the account or something that is triggered by the account creation.

I have seen this error before when I failed to add the user I was using to connect to the CRM organization.

You can dig deeper into the error by turning on tracing on the server using https://crmdiagtool2011.codeplex.com/ and reading the trace logs using https://crmtracereader.codeplex.com/

Upvotes: 2

Related Questions