Retrieve accounts from Marketing List of Type “Dynamic” in CRM 2016

Hi All,

It is possible to retrieve accounts from Marketing List of Type “Dynamic” in CRM  in C#.

Below is the code to retrieve accounts.

 

private void getDynamicListMembers(Guid ListId)
{
RetrieveAccounts retrieveDynamicAccount = new RetrieveAccounts();
ColumnSet cols = new ColumnSet(new string[] { “query” });
var entity = service.Retrieve(“list”, ListId, cols);
var dynamicQuery = entity.Attributes[“query”].ToString();
EntityCollection dynamicAccounts = service.RetrieveMultiple(new FetchExpression(dynamicQuery));
}

here

ListId — Marketing List Id of type “Dynamic”

Hope this helps 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s