跳至主要內容

销售交货单:限制必须有来源单据

五六零网校小于 1 分钟

代码示例

IF @object_type = '15'
	BEGIN
		IF @transaction_type = 'A'
			BEGIN
				IF EXISTS (
					SELECT T1.[BaseEntry]
					FROM ODLN T0
						INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
					WHERE T1.[BaseEntry] IS NULL
						AND T0.DocEntry = @list_of_cols_val_tab_del
				)
					BEGIN
						SET @error = 151;
						SET @error_message = '销售交货单必须有来源单据于订单';
					END;
			END;
	END