m_product_bom_trg.sql
来自「Java写的ERP系统」· SQL 代码 · 共 27 行
SQL
27 行
CREATE OR REPLACE TRIGGER M_Product_BOM_Trg
AFTER INSERT OR UPDATE OF M_ProductBOM_ID
ON M_Product_BOM
FOR EACH ROW
/******************************************************************************
* ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA
* Open Source Software Provided "AS IS" without warranty or liability
* When you use any parts (changed or unchanged), add "Powered by Compiere" to
* your product name; See license details http://www.compiere.org/license.html
******************************************************************************
* Reset Verification flag of parent
*/
BEGIN
IF (INSERTING) THEN
UPDATE M_Product
SET IsVerified='N'
WHERE M_Product_ID=:new.M_Product_ID
AND IsVerified='Y';
ELSIF (UPDATING AND :new.M_ProductBOM_ID<>:old.M_ProductBOM_ID) THEN
UPDATE M_Product
SET IsVerified='N'
WHERE M_Product_ID=:new.M_Product_ID
AND IsVerified='Y';
END IF;
END M_Product_BOM_Trg;
/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?