Dynamics CRM Generic SQL Error
One way a generic SQL error can occur is when dealing with ConditionOperator in QueryExpression. Consider the following code to get all users who’s first name is Bob: QueryExpression userquery = new QueryExpression(); userquery.EntityName = “systemuser”; ColumnSet cols = new ColumnSet(); cols.AddColumn(“systemuserid”); userquery.ColumnSet = cols; ConditionExpression ce = new ConditionExpression(); ce.AttributeName = “firstname”; ce.Operator = ConditionOperator.Contains; ce.Values.Add(“Bob”); FilterExpression filter1 = new FilterExpression(); filter1.Conditions.Add(ce); userquery.Criteria.AddFilter(filter1); EntityCollection entColRoles = _orgService.RetrieveMultiple(userquery); if (entColRoles != null && … Continue reading Dynamics CRM Generic SQL Error