ad_user_trg.sql

来自「Java写的ERP系统」· SQL 代码 · 共 25 行

SQL
25
字号
CREATE OR REPLACE TRIGGER AD_User_Trg
AFTER INSERT OR UPDATE OF EMail, C_BPartner_ID
	ON AD_User
FOR EACH ROW
/*************************************************************************
 * 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-2003 Jorg Janke, ComPiere, Inc. All Rights Reserved.
 *************************************************************************
 * $Id: AD_User_Trg.sql,v 1.1 2003/04/06 01:59:59 jjanke Exp $
 ***
 * Title:	Sync EMail
 * Description:
 *	May be a problem if more than one contact
 ************************************************************************/
BEGIN
	IF (:new.C_BPartner_ID IS NOT NULL AND :new.EMail IS NOT NULL) THEN
		UPDATE	C_BPartner_Contact
		  SET	EMail = :new.EMail
		WHERE	C_BPartner_ID = :new.C_BPartner_ID;
	END IF;
END AD_User_Trg;
/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?