Trigger not working while changeing the values of UDF
I have created one Trigger for ORDR for Sales order. It is working fine. For that i have created two UDF to Title level. When i fill all fields it shows the correct result in DocTotal. But problem is that, while updateing specific record it also update but only refresh the DocTotal.
Means suppose i change the value of UDF fields that time it is not working it gives following error.
"There is difference between the document total and component total"
ALTER TRIGGER AmountForPC1
SET NOCOUNT ON
SET x.DocTotal = COALESCE(i.DocTotalSy, 0) + COALESCE(i.U_Ref, 0) + COALESCE(i.U_Sub, 0)
FROM dbo.ORDR AS x
INNER JOIN inserted AS i ON i.DocEntry = x.DocEntry