Skip to Content
avatar image
Former Member

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

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 26 at 09:05 AM

    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
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 25 at 08:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded