CRM 2011 ActivityPointer Earlybound 类型生成不正确?

发布于 2024-12-12 01:44:38 字数 713 浏览 0 评论 0原文

我尝试在 CRM 2011 中运行此查询:

var activity = (from a in crmService.ActivityPointerSet
                where a.StateCode == ActivityPointerState.Open &&
                      a.ActivityTypeCode == "4201"
                select a).First();

但出现此错误:

Microsoft.Crm.Metadata.EntityMetadataNotFoundException: The entity with a name = '4201' was not found in the MetadataCache

检查 FilteredActivityPointer 数据库视图后,我注意到该列被定义为 int,而不是字符串。我手动编辑了生成的类,将属性上的字符串更改为 int,并且效果很好。

早期绑定类型生成器 (CrmSvcUtil.exe) 中是否存在错误,或者我是否以某种方式创建了错误的它?

编辑:经过更多测试后,ActivityTypeCode 似乎需要字符串“appointment”。不知道为什么它在数据库中显示不同......

I tried running this Query in CRM 2011:

var activity = (from a in crmService.ActivityPointerSet
                where a.StateCode == ActivityPointerState.Open &&
                      a.ActivityTypeCode == "4201"
                select a).First();

But I got this error:

Microsoft.Crm.Metadata.EntityMetadataNotFoundException: The entity with a name = '4201' was not found in the MetadataCache

After checking with the FilteredActivityPointer database view, I noticed that that column was defined as an int, not a string. I manually edited the generated class, changing the string to an int on the property, and it worked just fine.

Is there a bug in the early bound type generator (CrmSvcUtil.exe), or did I somehow create it wrong?

EDIT: After some more testing, it looks like the ActivityTypeCode is expecting the string "appointment". Don't know why it's showing differently in the database though...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌吟 2024-12-19 01:44:38

我想他们这样做是因为 ObjectTypeCodes 不能保证在不同的部署中是相同的(如果您有多个部署)。

通过使用“任务”、“约会”或“电子邮件”等,不会产生歧义。

我同意这看起来有点奇怪!

I would imagine they have done this as ObjectTypeCodes are not guaranteed to be the same across different deployments (if you have more than one).

By using 'task', 'appointment' or 'email' (etc) there is no ambiguity.

I agree it seems a bit strange though!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文