0

システム エンティティのカスタム フィールドを作成しました。レイト バインディングを介して XRM Web サービスから属性値にアクセスするにはどうすればよいですか?

私はこのコードを使用していますが、それは私にEntityReferenceオブジェクトを与えます:

Entity objCase = service.Retrieve("incident", new Guid(Request.QueryString["EntityID"]), attributes);
string strValue = objCase.Attributes["new_papid"]).ToString();
4

1 に答える 1

3

ルックアップ値を取得しています。この場合、最初にエンティティ参照にキャストする必要があります

Entity objCase = service.Retrieve("incident", new Guid(Request.QueryString["EntityID"]), attributes);
EntityReference pap = (EntityReference)objCase.Attributes["new_papid"];
Guid papId = pap.Id; // ID of the record;
string papName = pap.Name; // Primary attribute of the entity;
于 2013-04-05T08:57:14.423 に答える