ALTER proc SBO_SP_TransactionNotification
@object_type nvarchar(25), -- SBO Object Type
@transaction_type nchar(1), -- [A]dd, pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error int -- Result (0 for no error)
declare @error_message nvarchar (200) -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
declare @aaa nvarchar (200) --用于存放判断字段baseline
--------------------------------------------------------------------------------------------------------------------------------
-- ADD YOUR CODE HERE
if @object_type='20'--ePurchaseDeliveryNote
begin
if @transaction_type='A'
begin
select @aaa =baseline from Pdn1 where DocEntry = @list_of_cols_val_tab_del
if @aaa is Null
begin
set @error=1
set @error_message='必须基于采购订单或退货单才能收货!'
end
end
end
--------------------------------------------------------------------------------------------------------------------------------
-- Select the return values
select @error, @error_message
end