I want to get marketing list Account and contact member, But i can not find the member's entity.
*This post is locked for comments
I want to get marketing list Account and contact member, But i can not find the member's entity.
*This post is locked for comments
Andrew,
Copied some old code that I had. Didn't check into too much detail, but it is working in some solution.
Thanks for the catch, I will fix it in the solution.
All the best.
Aric,
The second Link makes no sense in this particular case. It's possible to filter based on intersect entity.
You can use the following query expression to retrieve list members:
QueryExpression query = new QueryExpression()
{
EntityName = "contact",
ColumnSet = columns,
LinkEntities =
{
new LinkEntity()
{
LinkToEntityName = "listmember",
LinkToAttributeName = "entityid",
LinkFromAttributeName = "contactid",
LinkEntities =
{
new LinkEntity()
{
LinkToEntityName = "list",
LinkToAttributeName = "listid",
LinkFromAttributeName = "listid",
LinkCriteria =
{
Conditions =
{
new ConditionExpression("listid", ConditionOperator.Equal, listid)
}
}
}
}
}
}
};
If you are using a Dynamic List, you can use the following:
Entity list = service.Retrieve("list", listId, new ColumnSet(true));
listType = (bool)list.Attributes["type"];
query = list.Contains("query") ? list.Attributes["query"].ToString() : string.Empty;
FetchExpression fe = new FetchExpression(query);
EntityCollection rc = service.RetrieveMultiple(fe);
Hope this helps...
Hi Evan li,
Did you use QueryExpression with the LinkEntity property to properly assemble the query?
Evan, I'm sorry for this. It seems that this code is related to v 4.0. Let me bring you another example - nishantrana.me/.../sample-code-to-retrieve-all-the-members-of-a-static-marketing-list-in-crm-2011
Hi Andrew,
Thank you for your help.
In below code
[Code]
RetrieveMultipleRequest request = new RetrieveMultipleRequest { ReturnDynamicEntities = true, Query = query };
RetrieveMultipleResponse response = (RetrieveMultipleResponse)crmService.Execute(request);
retVar = (response.BusinessEntityCollection.BusinessEntities.Count > 0);
[/Code]
I can not find the attribute : RetrieveMultipleRequest.ReturnDynamicEntities and RetrieveMultipleResponse.BusinessEntityCollection
Hi Evan li,
What are you trying to achieve with your plug-in?
The "Targeted At" field has a schema name of createdfromcode, and a Description of "Select the type of members that this marketing list will contain: accounts, contacts, or leads. Each list can have only one member type and this value can't be changed after the marketing list is created.” The Members section is usually for displaying accounts, contacts, and leads.
Hello,
You should look for listmember entity. It's intersect N-N entity.
Check this article - community.dynamics.com/.../learning-how-to-query-for-marketing-list-members
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156