cancel
Showing results for 
Search instead for 
Did you mean: 

Can you put a validation on Serial Number Details window through sp_transaction nofication?

Former Member
0 Kudos

Ive tried this but it does not work.

USE [MYJEWELS]
GO
/****** Object:  StoredProcedure [dbo].[SBO_SP_TransactionNotification]    Script Date: 25/01/2018 1:53:21 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SBO_SP_TransactionNotification] 
@object_type nvarchar(30), -- SBO Object Type
@transaction_type nchar(1),-- [A]dd, [U]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'
--------------------------------------------------------------------------------------------------------------------------------
--ADDYOURCODEHERE
IF @transaction_type IN ('A','U') AND (@object_type in('47','94', '100') )
BEGIN
set @error = 1;
set @error_message = 'test';
END
--------------------------------------------------------------------------------------------------------------------------------
-- Select the return values
select @error, @error_message
end

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sir Jimmy, Ive tried doing what you have told but still not working

USE [MYJEWELS]
GO
/****** Object:  StoredProcedure [dbo].[SBO_SP_TransactionNotification]    Script Date: 26/01/2018 3:29:53 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SBO_SP_TransactionNotification] 
@object_type nvarchar(30), -- SBO Object Type
@transaction_type nchar(1),-- [A]dd, [U]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'
--------------------------------------------------------------------------------------------------------------------------------
--ADDYOURCODEHERE
IF @object_type = '10000045' AND @transaction_type IN ('U')
BEGIN
SET @error = -1;
set @error_message = 'Test';
END 
--------------------------------------------------------------------------------------------------------------------------------
-- Select the return values
select @error, @error_message
end
jimmyl
Participant
0 Kudos

Hi Victor,

The "Serial Number Details" window seems to be based on the table OSRN. Can you try to put object type "10000045"?

Cheers,

Jimmy