问题
I'm building the following query. For some reason, it doesn't bring to me all the fields. I've checked the spelling and when I assign values to those field, I even switched the name, leading to an exception. So I know for sure that they exist and are used. I'm adding a pre-image to the update-step with all data, just to be sure.
QueryExpression request = new QueryExpression
{
EntityName = "myLogicalName",
ColumnSet = new ColumnSet { AllColumns = true },
Criteria =
{
Filters =
{
new FilterExpression
{
FilterOperator = LogicalOperator.Or,
Conditions =
{
new ConditionExpression("someField", ConditionOperator.NotEqual, someValue),
new ConditionExpression("someField", ConditionOperator.Equal, somValue)
}
}
}
}
};
EntityCollection result = Service.RetrieveMultiple(request);
What can I be possibly missing?!
回答1:
Its probably because; the field does not have a value or field level security is being applied.
As a side generally you should avoid using AllColumns = true
回答2:
Setting the AllColumns
property to true is essentially the same as doing a Select *
in sql. The columns won't be adding to the ColumnSet, but they will be returned in the results of your query expression.
来源:https://stackoverflow.com/questions/13077691/not-all-columns-retrieved-on-new-columnsettrue-in-a-plug-in