|
问题一:自定义表单的左侧可以关联选择多个客户吗?类似于市场活动这样的模块
答案:可以设置,脚本如下:
DROP PROCEDURE IF EXISTS `ldcrm_cusomform_relatelistaccounts`;
delimiter ||
CREATE PROCEDURE `ldcrm_cusomform_relatelistaccounts`(
tmp_module VARCHAR(100)
)
BEGIN
IF tmp_module LIKE 'CustomForm%' AND EXISTS (SELECT 1 FROM ld_tab WHERE `name`=tmp_module) THEN
SET @modulename=tmp_module;
SET @tabid=(SELECT tabid FROM ld_tab WHERE `name`=@modulename);
SET @maxrelation_id=(SELECT MAX(relation_id) FROM ld_relatedlists);
UPDATE ld_relatedlists SET sequence=sequence+1 WHERE tabid=@tabid;
INSERT INTO ld_relatedlists(
relation_id,
tabid,
related_tabid,
`name`,
sequence,
label,
presence,
actions,
mobile_presence,
mobile_sequence,
type,
related_coltable,
wx_presence,
wx_sequence,
trade
)
SELECT
@maxrelation_id+1,
@tabid,
6,
'get_accounts',
1,
'Accounts',
0,
'add,sendemail,select',
0,
3,
'crmentityrel_datacategory_sql',
'crmentityrel.crmid',
0,
0,
NULL
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM ld_relatedlists WHERE tabid=@tabid AND `name`='get_accounts' AND type='crmentityrel_datacategory_sql');
UPDATE ld_relatedlists_seq SET id=(SELECT MAX(relation_id) FROM ld_relatedlists);
SET @i=0;
UPDATE ld_relatedlists SET sequence=(@i:=@i+1) WHERE tabid=@tabid ORDER BY sequence;
END IF;
END ||
delimiter;
-- 只适用于自定义表单,调用方法:参数传入自定义表单模块名称
CALL ldcrm_cusomform_relatelistaccounts('CustomForm08');
|
|