简体   繁体   English

如何通过API在CRM Dynamics中创建自定义实体本身

[英]How to create custom entity itself in CRM Dynamics via API

Is there way I can connect to CRM dynamics and create custom entity itself. 有没有办法我可以连接到CRM动态并创建自定义实体本身。 In API, I will pass entity name, fields, datatype and etc details required for creating custom entity. 在API中,我将传递创建自定义实体所需的实体名称,字段,数据类型等详细信息。

I would like to use C# for making API calls. 我想使用C#进行API调用。

Yes. 是。 You need to use the Metadata services. 您需要使用元数据服务。

Sample: Create and update entity metadata . 样本:创建和更新实体元数据

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 实体删除前的 Dynamics CRM 自定义工作流程 - Dynamics CRM custom workflow before entity deletion 动态CRM CRM创建报价没有机会 - dynamics crm api create quote without opportunity Dynamics CRM 2011 - 通过插件阻止实体创建 - Dynamics CRM 2011 - Block Creation of Entity via Plugin 如何使用ssis脚本组件更新Dynamics CRM中定价批准产品(自定义实体)中的“名称”字段 - How to update Name field in Pricing Approval Products(Custom Entity) in Dynamics CRM using ssis script component 是否可以通过API在Dynamics CRM中定义具有属性的新实体类型? - Is it possible to define a new entity type with attributes in Dynamics CRM through API? CRM Dynamics 365:如何通过 REST API 获取非全局选项集值元数据? - CRM Dynamics 365: How to get the non global optionset values metadata via REST API? 是否可以在MS Dynamics CRM 2015中创建虚拟实体? - Is it posible to create a virtual entity in MS Dynamics CRM 2015? Microsoft Dynamics CRM API - Microsoft Dynamics CRM API How to Create Case in Microsoft Dynamics CRM 2016 (Version 8) using webservices or REST API in JAVA or C#? - How to Create Case in Microsoft Dynamics CRM 2016 (Version 8) using webservices or REST API in JAVA or C#? 自定义代码活动无法在Dynamics CRM中为订单创建关注 - Custom Code activity is not working to create a follow for an Order in dynamics crm
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM