Good morning.
to start of i am not a programmer so i try to help myself as i go by, but i ran into a problem.
i created an update trigger on opeertunities custom which whould to a sum of all the contacts opertunities and update a field with that value.
the update works but the trigger only fires if you press save twice?? i know theres something like an inserted column, but there it flies above my radar. please help.
here is the trigger below
ip_income_provider_info_cstm is a custom module i built with module builder -
-----------------------------------------------------------------------------------
ALTER TRIGGER [dbo].[ipassosiattejan]
ON [dbo].[opportunities_cstm]
after INSERT,DELETE,UPDATE
AS
--------------------------------------------------------------
BEGIN
UPDATE ip_income_provider_info_cstm
SET sales_total1_c = Sales_Activity_Per_ip.l0_cstm_sum_association_amou
FROM Sales_Activity_Per_ip INNER JOIN
ip_income_provider_info_cstm ON Sales_Activity_Per_ip.id = ip_income_provider_info_cstm.id_c AND
Sales_Activity_Per_ip.l0_cstm_sum_association_amou <> ip_income_provider_info_cstm.sales_total1_c
WHERE (Sales_Activity_Per_ip.income_generator_month_c = 'january')
SET NOCOUNT ON;
END


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks