Export (0) Print
Expand All

Use the ColumnSet class

Applies To: CRM 2015 on-prem, CRM Online

In Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update, you can use the ColumnSet class to specify what attributes to return from a query expression. The query returns only non-null values.

You can also use the ColumnSet class to reduce the size of a query result by defining only those attributes to be returned. To improve server performance, it is recommended that you don’t execute a query that returns all columns.

The following code example shows how to use the ColumnSet class to specify what attributes to return from a query expression.

QueryExpression contactquery = new QueryExpression {  EntityName="contact",  ColumnSet = new ColumnSet("firstname", "lastname", "contactid") };

See Also

Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.
Show:
© 2014 Microsoft