RetrieveMultiple 不返回所有属性
我正在针对相当标准的 CRM 4.0 安装运行以下代码。
List<ConditionExpression> cons = new List<ConditionExpression>();
QueryExpression query = new QueryExpression();
query.EntityName = "systemuser";
cons.Add(new ConditionExpression());
cons[cons.Count - 1].AttributeName = "isdisabled";
cons[cons.Count - 1].Operator = ConditionOperator.Equal;
cons[cons.Count - 1].Values = new object[] { false };
FilterExpression filter = new FilterExpression();
// Set the properties of the filter.
filter.FilterOperator = LogicalOperator.And;
filter.Conditions.AddRange(cons.ToArray());
//query.ColumnSet = new AllColumns();
query.ColumnSet = new ColumnSet(new string[]{"systemuserid","fullname","firstname","lastname"});
query.Criteria = filter;
query.Orders.Add(new OrderExpression("fullname", OrderType.Ascending));
RetrieveMultipleRequest RMR = new RetrieveMultipleRequest();
RMR.Query = query;
RMR.ReturnDynamicEntities = true;
RetrieveMultipleResponse resp = (RetrieveMultipleResponse)CRM.Execute(RMR);
由于某种原因,返回的动态实体列表仅包含 systemuserid 属性。如果我使用 AllColumns(),我会得到一系列列(绝不是全部)的选择,其中仍然不包括全名、名字和姓氏列。
相关记录肯定具有所请求字段的值。
有什么想法...?
I'm running the following code against a fairly standard CRM 4.0 installation.
List<ConditionExpression> cons = new List<ConditionExpression>();
QueryExpression query = new QueryExpression();
query.EntityName = "systemuser";
cons.Add(new ConditionExpression());
cons[cons.Count - 1].AttributeName = "isdisabled";
cons[cons.Count - 1].Operator = ConditionOperator.Equal;
cons[cons.Count - 1].Values = new object[] { false };
FilterExpression filter = new FilterExpression();
// Set the properties of the filter.
filter.FilterOperator = LogicalOperator.And;
filter.Conditions.AddRange(cons.ToArray());
//query.ColumnSet = new AllColumns();
query.ColumnSet = new ColumnSet(new string[]{"systemuserid","fullname","firstname","lastname"});
query.Criteria = filter;
query.Orders.Add(new OrderExpression("fullname", OrderType.Ascending));
RetrieveMultipleRequest RMR = new RetrieveMultipleRequest();
RMR.Query = query;
RMR.ReturnDynamicEntities = true;
RetrieveMultipleResponse resp = (RetrieveMultipleResponse)CRM.Execute(RMR);
For some reason the list of dynamic entities which is returned only contains the systemuserid attribute. If I use an AllColumns() I get a selection of columns (by no means all) which still does not include the fullname, firstname and lastname columns.
The records in question definitly have values for the requested fields.
Any thoughts...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决 - 一个系统用户的名字、姓氏和全名的值为空 - 填写这些值会使查询开始为所有其他用户检索这些值。
Resolved - one system user had blank values for firstname, lastname and fullname - filling these in made the query start retrieving these values for all the other users as well.