0
私はアカウントIDを持っており、メールリストを作成するためにアカウントの連絡先のコレクションを取得したいと考えています。アカウントの連絡先をすべて取得し、電子メールリストをMS Dynamics CRMに作成する方法は?
//build up Email
private Email BuildEmail(ActivityParty allcontacts){.... build my emailhere}
private List<Entity> GetAllContactsFromAccountId(Guid accountId, List<Entity> toList)
{
//how can I get all the contacts here
foreach (Entity contact in Account.Contact.Entities)//????
{
Entity activityParty = new Entity("activityparty");
activityParty["partyid"] = new EntityReference("??", e.Id);
if (toList.Any(t => t.GetAttributeValue<EntityReference>("partyid").Id == e.Id)) continue;
toList.Add(activityParty);
}
return toList;
}
回答ありがとうございますが、変換エラーです。例えば、私はGetとErrorが 'entityreference'に' entitycollection'を変換できない – transformer
EntityCollection型のOut putパラメータを使うことができると思います。 [Output( "Contacts")] [ReferenceTarget( "contact")] 公開OutArgument連絡先{get;セット; }。 そして、明らかにentityCollectionオブジェクトをentityReferenceに設定することはできません。 –