有什么方法可以连接到 CRM 动态并创建自定义实体本身。在 API 中,我将传递创建自定义实体所需的实体名称、字段、数据类型等详细信息。
我想使用 C# 进行 API 调用。
是的。您需要使用元数据服务。
CreateEntityRequest createrequest = new CreateEntityRequest
{
//Define the entity
Entity = new EntityMetadata
{
SchemaName = _customEntityName,
DisplayName = new Label("Bank Account", 1033),
DisplayCollectionName = new Label("Bank Accounts", 1033),
Description = new Label("An entity to store information about customer bank accounts", 1033),
OwnershipType = OwnershipTypes.UserOwned,
IsActivity = false,
},
// Define the primary attribute for the entity
PrimaryAttribute = new StringAttributeMetadata
{
SchemaName = "new_accountname",
RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
MaxLength = 100,
FormatName = StringFormatName.Text,
DisplayName = new Label("Account Name", 1033),
Description = new Label("The primary attribute for the Bank Account entity.", 1033)
}
};
_serviceProxy.Execute(createrequest);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句