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(); }

11 views0 comments

Recent Posts

See All

CRM 365 - Customer field only show Accounts

On a customer field, if the requirement is to only show Accounts, please add this line to the OnLoad of the form: //Show only Account records when selecting the Customer formContext.getControl("cu

Execute Workflow Request on CRM 365 Cloud

Please find below an example of calling the Execute method to run a workflow on CRM 365 Cloud. let Id = formContext.data.entity.getId().replace('{', '').replace('}', ''); let request =

Comments


bottom of page