2016-10-13 2 views
0

this blogに続いて、Microsoft Dynamics CRM SDKプロジェクトのDAL_AccountEntity.csクラス内にSaveAccountメソッドを設定しました。エラーが発生しました。システム管理者に問い合わせるか、Microsoft Dynamics CRM SDKのトラブルシューティングガイドを参照してください

我々はOrganizationService.Create

を使用して新しいレコードを追加しようとするたびにそれは次のエラースロー:

Server Error in '/' Application.


An error occurred. Contact a system administrator or refer to the Microsoft Dynamics CRM SDK troubleshooting guide.

Exception Details: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred. Contact a system administrator or refer to the Microsoft Dynamics CRM SDK troubleshooting guide.

ソースエラー:あなたがOnPremiseを使用している場合

Line 28:     if (objAccountModel.AccountID == Guid.Empty) 
Line 29:     { 
Line 30:      objAccountModel.AccountID = service.Create(AccountEntity); 
Line 31:     } 
Line 32:     else 
+0

[Vijayのコメント](https://community.dynamics.com/crm/f/117/t/120680) – xameeramir

答えて

2

を、例外の詳細を取得できるように、CRMのweb.configにincludeExceptionDetailInFaultsを追加してみてくださいまたは、CRMがインストールされているサーバーのイベントビューアでエラーを探します。

たぶん、接続文字列が間違っている、またはユーザーアカウントがアクセス権を持っていない、それは例外の詳細を知らなくても何でもかまいません...

+0

次の問題を解決しました。[online](http://stackoverflow.com/questions/tagged)/dynamics-crm-online)体験版 - まだ評価中です – xameeramir

1

この行は、魚に見え

AccountEntity["primarycontactid"] = new Microsoft.Xrm.Sdk.EntityReference { Id = objAccountModel.PrimaryContact.Id, LogicalName = "account" }; 

同上割り当てられたオブジェクトがPrimaryContactですが、LogicalNameがaccountに設定されている場合は、LogicalNameをcontactに変更するか、正しいaccountidを割り当ててみてください。

関連する問題