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?