gpt4 book ai didi

dynamics-crm-2011 - 如何将 CRM 4 类型更改为 CRM 2011

转载 作者:行者123 更新时间:2023-12-02 05:18:03 27 4
gpt4 key购买 nike

我正在尝试将 crm 4 插件转换为 CRM 2011。有谁知道 CRm 2011 中的相应类型是什么?

Customer, CrmDateTime, CrmDecimal, CrmFloat, CBoolean, CrmMoney, Owner, Picklist, Key, Status, UniqueIdentifier, CrmBoolean

public static object GetAttributeValue(this Entity target, string attributeLogicalName)
{
object value;
if (target.Attributes.Contains(attributeLogicalName))
{
value = target.Attributes[attributeLogicalName];
if ((value is Boolean) || (value is string))
return value;
else if (value is Customer)
return ((Customer)value).Value;
else if (value is CrmDateTime)
return ((CrmDateTime)value).UserTime;
else if (value is CrmDecimal)
return ((CrmDecimal)value).Value;
else if (value is CrmFloat)
return ((CrmFloat)value).Value;
else if (value is CrmNumber)
return ((CrmNumber)value).Value;
else if (value is CBoolean)
return ((CrmBoolean)value).Value;
else if (value is Lookup)
return ((Lookup)value).Value;
else if (value is CrmMoney)
return ((CrmMoney)value).Value;
else if (value is Owner)
return ((Owner)value).Value;
else if (value is Picklist)
return ((Picklist)value).Value;
else if (value is Key)
return ((Key)value).Value;
else if (value is Status)
return ((Status)value).Value;
else if (value is UniqueIdentifier)
return ((UniqueIdentifier)value).Value;
else if (value is CrmBoolean)
return ((CrmBoolean)value).Value;
return null;
}
else
return null;
}

最佳答案

自 Dynamics CRM 2011 起,不再需要自定义类型来替代 .NET 类型。您可以(并且必须)使用标准的 .NET 类型。参见 Types in the Microsoft Dynamics CRM SDK类型映射的描述。

CRM 3 和 CRM 4 中存在自定义类型(CrmBoolean,...)是必要的,因为 CRM 3 基于 .NET 1,其中没有可空类型。

关于dynamics-crm-2011 - 如何将 CRM 4 类型更改为 CRM 2011,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14316276/

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