解决方法:
通过触发器实现,创建销售机会时,自动带过来客户的联系人为销售机会联系人
drop trigger if exists insert_contpotentialrel;
delimiter ||
CREATE TRIGGER insert_contpotentialrel
AFTER INSERT ON ld_potential
FOR EACH ROW
BEGIN
IF new.accountid>0 THEN
insert into ld_contpotentialrel(contactid,potentialid)
select contactid,new.potentialid from ld_contactdetails where accountid=new.accountid;
END IF;
END ||
delimiter;
|