Logo trigger ozel kod
https://www.youtube.com/watch?v=JFHKa3PEYuQ
CREATE TRIGGER KOD
ON LG_005_01_INVOICE
FOR INSERT
AS
DECLARE @GRPCODE INT, @SPECODE NVARCHAR(20), @LOGICALREF INT
SELECT @GRPCODE = GRPCODE, @SPECODE = SPECODE, @LOGICALREF = LOGICALREF FROM INSERTED
IF (@GRPCODE =1)
BEGIN
UPDATE LG_005_01_INVOICE SET SPECODE = 'ALIŞ' WHERE LOGICALREF = @LOGICALREF
END
ELSE
BEGIN
UPDATE LG_005_01_INVOICE SET SPECODE ='SATIŞ' WHERE LOGICALREF =@LOGICALREF
END
https://www.youtube.com/watch?v=JFHKa3PEYuQ
CREATE TRIGGER KOD
ON LG_005_01_INVOICE
FOR INSERT
AS
DECLARE @GRPCODE INT, @SPECODE NVARCHAR(20), @LOGICALREF INT
SELECT @GRPCODE = GRPCODE, @SPECODE = SPECODE, @LOGICALREF = LOGICALREF FROM INSERTED
IF (@GRPCODE =1)
BEGIN
UPDATE LG_005_01_INVOICE SET SPECODE = 'ALIŞ' WHERE LOGICALREF = @LOGICALREF
END
ELSE
BEGIN
UPDATE LG_005_01_INVOICE SET SPECODE ='SATIŞ' WHERE LOGICALREF =@LOGICALREF
END