エンティティをフェッチContact
しておりAccount
、連絡先の名前と主要連絡先の名前にアクセスしたいと考えています。最初のものは非常に簡単にアクセスできますが、
EntityCollection result = proxy.RetrieveMultiple(...);
Entity entity = result.Entities[0].Attributes["fullname"];
もう1つは、例外をスローして私と戦っているようです。<entity>
私が見る限り、前者の場合は直接名前の属性を持ち、後者の場合は名前の属性を持つフェッチ XML に依存します<entity><link-entity>
。
fullname
リンクされたエンティティであるフィールドにアクセスするにはどうすればよいですか?
連絡先の XML をフェッチします。
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
<entity name='contact'>
<attribute name='fullname' />
</entity>
</fetch>
アカウントの主要連絡先の XML をフェッチします。
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
<entity name='account'>
<attribute name='accountid'/>
<link-entity name='listmember' from='entityid' to='accountid' visible='false' intersect='true'>
<link-entity name='list' from='listid' to='listid' alias='ab'>
</link-entity>
</link-entity>
<link-entity name='contact' from='contactid' to='primarycontactid' visible='false' link-type='outer' alias='...'>
<attribute name='fullname'/>
</link-entity>
</entity>
</fetch>