TR_OPPORTUNITY_TASYNC_D
Definition
Copy
CREATE trigger TR_OPPORTUNITY_TASYNC_D on dbo.OPPORTUNITY after delete not for replication
as begin
-- Excluding the normal condition that the delete is not performed by the sync.
-- This table is mapped B2T to a different table than the original TA table, and this needs to behave
-- in the same manner whether the row comes from TA or BBEC originally.
merge dbo.TA_OPPORTUNITY t
using (select ID from DELETED) d
on (d.ID = t.ID)
when matched and t.ACTIONCODE = 1 then
delete
when matched then
update set ACTIONCODE = 3;
end