0
Ich habe eine Kontonummer und möchte die Sammlung von Kontakten unter dem Konto abrufen, um eine E-Mail-Liste zu erstellen.Wie Sie alle Kontakte eines Kontos erhalten und eine E-Mail-Liste in MS Dynamics CRM erstellen?
//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;
}
danke für die Antwort, aber es gibt mir Konvertierungsfehler. Für z.B. Wann, gebe ich dies als entitycollection in einem benutzerdefinierten Workflow zu TargetOutput ref ... ("Kontakt") Ich bekomme und Fehler kann nicht umgewandelt werden "entitycollection" zu "entityreference" – transformer
Ich denke, Sie können Out Put Parameter von EntityCollection-Typ verwenden. wie [Output ("Kontakte")] [ReferenceTarget ("contact")] public OutArgument Kontakte {get; einstellen; }. Und offensichtlich können Sie EntityCollection-Objekt nicht auf eine EntityReference festlegen. –