📄 m_productionplan_trg.sql
字号:
CREATE OR REPLACE TRIGGER M_ProductionPlan_Trg
AFTER DELETE OR INSERT OR UPDATE
ON M_ProductionPlan
FOR EACH ROW
DECLARE
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: M_ProductionPlan_Trg.sql,v 1.2 2002/05/23 17:31:12 jjanke Exp $
***
* Title: ReadOnly Check
* Description:
************************************************************************/
v_ID NUMBER;
v_RO NUMBER;
BEGIN
-- Get ID
IF (UPDATING OR INSERTING) THEN
v_ID := :new.M_Production_ID;
ELSE
v_ID := :old.M_Production_ID;
END IF;
-- ReadOnly Check
SELECT COUNT(*)
INTO v_RO
FROM M_Production
WHERE M_Production_ID=v_ID
AND (Processed='Y' OR Posted='Y');
IF (v_RO > 0) THEN
RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted');
END IF;
END M_ProductionPlan_Trg;
/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -