I have this QueryExpression in my code.

 QueryExpression query = new QueryExpression() { };

 query.EntityName = "country";
 query.ColumnSet = new ColumnSet("name", "2digitiso", "3digitiso");

 EntityCollection retrieved = _service.RetrieveMultiple(query);

My question is, Is there a way to select all the columns in the "country" without providing any ColumnSet? pretty much I want something like the SELECT * from the SQL Query.

有帮助吗?

解决方案

Yes, if you change your third line to look like this

query.ColumnSet = new ColumnSet(true);

then it will select all columns

其他提示

Use this it works in CRM 2015

query.ColumnSet.AllColumns = true;

and do not set anything in

query.ColumnSet

yes that's right if you want retrieve all all columns means we have to specify the property "true" otherwise we have to customize the column set like ColumnSet ss=new ColumnSet("name","address","gender");

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top