Notifications
Announcements
No record found.
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
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
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.
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
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
Did you use QueryExpression with the LinkEntity property to properly assemble the query?
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",
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...
Aric,
The second Link makes no sense in this particular case. It's possible to filter based on intersect entity.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2