你的位置:灵当CRM >> 首页 >> 常见问题 >> 脚本应用 >> 详细内容

佣金单增加选择联系人

热度0票  浏览487次 时间:2016年7月28日 10:22

脚本内容:

set @modulename='Commission';

select tabid into @tabid from ld_tab where `name`=@modulename;

select blockid into @blockid from ld_blocks where tabid=@tabid and blocklabel='LBL_COMMISSION_INFO';

 

set @tablename='ld_commission';

set @columnname='contactid'; 

set @fieldname='contact_id';

set @zh='联系人姓名'; 

set @en='Product Name';

set @uitype=57; 

set @readonly=0; 

set @presence=2; 

set @defaultvalue=NULL;

set @displaytype=1;

set @typeofdata='I~O'; 

set @quickcreate=1; 

set @quickcreatesequence=NULL; 

set @info_type='BAS';

set @masseditable=1; 

 

select max(sequence) into @seq from ld_field where tabid=@tabid and block=@blockid;

 

select max(fieldid) into @fieldid from ld_field;

insert into ld_field(tabid,fieldid,columnname,tablename,generatedtype,uitype,fieldname,fieldlabel,readonly,presence,defaultvalue,maximumlength,sequence,block,displaytype,typeofdata,quickcreate,quickcreatesequence,info_type,masseditable,helpinfo,fieldonly)

select @tabid,@fieldid+1,@columnname,@tablename,1,@uitype,@fieldname,@zh,@readonly,@presence,@defaultvalue,100,@seq+1,@blockid,@displaytype,@typeofdata,@quickcreate,@quickcreatesequence,@info_type,@masseditable,NULL,0 from dual 

where not exists (select 1 from ld_field where tabid=@tabid and tablename=@tablename and columnname=@columnname); 

 

select fieldid into @fieldid from ld_field where tabid=@tabid and columnname=@columnname; 

insert into ld_tranlabel(languagetype,trantable,tabid,relateid,fieldlabel)
select 'zh','ld_field',@tabid,@fieldid,@zh from dual 

where not exists (select 1 from ld_tranlabel where languagetype = 'zh' and trantable ='ld_field' and tabid = @tabid and relateid=@fieldid);

 

insert into ld_tranlabel(languagetype,trantable,tabid,relateid,fieldlabel)
select 'en','ld_field',@tabid,@fieldid,@en from dual

where not exists (select 1 from ld_tranlabel where languagetype = 'en' and trantable ='ld_field' and tabid = @tabid and relateid=@fieldid);

 

select sequence into @seq from ld_field where tabid=@tabid and columnname='accountid'; 

update ld_field set sequence=sequence+1 where tabid=@tabid and block=@blockid and sequence>@seq; 

update ld_field set sequence=@seq+1,block=@blockid where tabid=@tabid and columnname='contactid';

set @i=0; 

update ld_field set sequence=(@i:=@i+1) where tabid=@tabid and block=@blockid order by sequence; 

delimiter; 

 

call AddColumn(@tablename,@columnname,'int','19','0');

delimiter; 

 

call fieldprofile('Commission');

delimiter;

call getallprofile('Commission'); 

delimiter; 

20160726_佣金单增加联系人姓名.rar(938 B )

上一篇 下一篇