Not all columns retrieved on `new ColumnSet(true)` in a plug-in

﹥>﹥吖頭↗ 提交于 2019-12-11 18:33:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!