top of page

CRM2015 – C# – DataCollection to List

Converting a DataCollection in a List in CRM can be done like the below example if using the strong type: QueryExpression qExpr = new QueryExpression(Account.EntityLogicalName); qExpr.ColumnSet = new ColumnSet(new string { “name” }); qExpr.Criteria = new FilterExpression(LogicalOperator.And); qExpr.Criteria.AddCondition(“name”, ConditionOperator.Like, “%Lda%”); EntityCollection col = service.RetrieveMultiple(qExpr); if (col != null && col.Entities != null) { List accs = col.Entities.Select(item => item.ToEntity()).ToList(); }

#CRM2015 #EntityCollectiontoList

7 views0 comments

Recent Posts

See All
bottom of page