gpt4 book ai didi

c# - 如何在 ObjectTypeCode 的 ConditionExpression 上传递实体的逻辑名称?

转载 作者:行者123 更新时间:2023-11-30 23:21:18 25 4
gpt4 key购买 nike

我有这段代码:

new QueryExpression
{
EntityName = "systemform",
ColumnSet = new ColumnSet("name"),
Criteria =
{
Conditions =
{
new ConditionExpression("objecttypecode", ConditionOperator.Equal, "account")
}
}
}

我可以用实体的实际 ObjectTypeCode 替换 "account" 并且这两种方法都有效。 CRM 是否通过逻辑名称推断出 ObjectTypeCode 以使其成为可能?

最佳答案

引自 MSDN

Always use the entity schema name (SchemaName) to refer to a custom entity in code and queries. Do not use the object type code (also referred to as entity type) code because tis integer value varies for custom entities in different organizations.

按照推荐指南,是的,CRM 似乎确实从逻辑名称解析 objecttypecode,它几乎表明相反的方法(从整数值解析 obecttypecode)可能并不总是有效适用于不同组织的自定义实体。

关于c# - 如何在 ObjectTypeCode 的 ConditionExpression 上传递实体的逻辑名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39253356/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com