zoukankan      html  css  js  c++  java
  • crm2011i创建nt类型字段

        using System;
        using Microsoft.Xrm.Sdk;
        using Microsoft.Xrm.Sdk.Messages;
        using Microsoft.Xrm.Sdk.Metadata;

        /// <summary>
        /// Int
        /// </summary>
        public class CreateIntAttribute
        {
            private string entityName = "new_class";

            public void Create(IOrganizationService service)
            {
                CreateAttributeRequest request = new CreateAttributeRequest();
                //关联的实体名称
                request.EntityName = entityName;
                IntegerAttributeMetadata intAttr = new IntegerAttributeMetadata();
                //字段名称
                intAttr.LogicalName = "new_intvalue";
                //架构名称
                intAttr.SchemaName = "new_intvalue";
                //显示中文名称
                intAttr.DisplayName = new Label("Int字段", 2052);
                //描写叙述
                intAttr.Description = new Label("Int字段", 2052);
                //需求级别
                intAttr.RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None);
                //字段安全性
                intAttr.IsSecured = false;
                //审核
                intAttr.IsAuditEnabled = new BooleanManagedProperty(false);
                //格式
                intAttr.Format = IntegerFormat.None;
                //最大值
                intAttr.MaxValue = 1000;
                //最小值
                intAttr.MinValue = 0;

                request.Attribute = intAttr;

                service.Execute(request);
            }
        }

    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    复制excel表中的数据
    微信H5页面分享获取JS-SDK
    JS中let、var、const的区别
    JS-对象常用方法整理
    JS-数组常用方法整理
    掌握一门新技术/语言需要哪些步骤?
    浅谈JavaScript中的内存管理
    js对象模型2
    ts中的装饰器
    ts中的泛型
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/4729604.html
Copyright © 2011-2022 走看看