MSCRM CRM 获取PickList 字段值函数解决方案

来源:互联网 发布:linux shell脚本 编辑:程序博客网 时间:2024/06/05 17:19

表单中有很多picklist字段 不想写链接stringmap
代码:

实体ID查询方法:
 SELECT ObjectTypeCode from Entity  where  name='实体名称'

调用函数方法:
select getpicklist('字段名称',字段值,实体ID)

复制代码
--@AttributeName 字段名称--@AttributeValue 字段值--@ObjectTypeCode 实体IDcreate function GetPickList(@AttributeName varchar(100),@AttributeValue int,@ObjectTypeCode int)returns varchar(100)asbegindeclare @value varchar(100) SELECT @value=Value FROM StringMap  where  AttributeName=@AttributeName AND AttributeValue=@AttributeValue and ObjectTypeCode=@ObjectTypeCode  return @valueend
复制代码

 

昨日龌龊不足夸,今日放荡思无涯。--华芯
原创粉丝点击