on 06-03-2011 1:12 PM
Hi All,
I've written a SP TRANSACTION NOTOFICATION.
ON pressing F5 SQL server 2008 is giving COMMAND(S) COMPLETELY SUCCESSFULLY.
BUT IN FRONT END NO RESULT.
I TRIED SQL PROFILER BUT THAT PROCEDURE IS NOT VISIBLE THERE.
Any help about calling it would be greatly appreciated.
Thanks
Malhaar
The system executes the SBO_SP_TransactionNotification procedures at the end of the transactions! So you should insert your code into this procedure to check the transaction!
(Or call your own procedure from this one.)
Edited by: István Körös on Jun 6, 2011 12:48 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I inserted above code into SBO_SP_TRANSACTIONNOTIFCATION and syste mthrew an error
SBO_SP_TRANSACTIONNOTIFICATION has too many arguements
below is my code
USE [Audio_Test]
GO
/****** Object: StoredProcedure [dbo].[SBO_SP_TransactionNotification] Script Date: 06/07/2011 11:06:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(25), -- 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'
-
-- ADD YOUR CODE HERE
-
-- Select the return values
IF (@object_type = '2') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.CardCode FROM OCRD T0 Where (T0.GroupNum != 4 or T0.GroupCode != 116) and T0.UserSign = 1 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
SET @error = 30
SET @error_message =N'You are not authorized to change payment terms and customer group'
End
END
-- select @error,@error_message
end
Hi Malhaar....
Forget Your code and just Run this code as it is.......
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(20), -- 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'
--------------------------------------------------------------------------------------------------------------------------------
-- ADD YOUR CODE HERE
IF (@object_type = '2') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.CardCode FROM OCRD T0 Where (T0.GroupNum != 4 And T0.GroupCode != 116) and T0.UserSign = 16 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
Select @error = -1,
@error_message ='You are not authorized to change payment terms and customer group'
End
END
--------------------------------------------------------------------------------------------------------------------------------
-- Select the return values
select @error, @error_message
end
Regards,
Rahul
Hi Malhaar,
You can only test SP when you enter some data in front end. What is the goal of this SP? What do you want to block?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gordon,
One particular user should select payment term as 'ADVANCE PAYMENT' and group as 'SERVICE CUSTOMER' only while adding a business partner.
but when i added a business partner with payment term and group other than mentioned above, the BP got added without any error message.
I'm stuck as to how to make this call.
Thanks
Malhaar
H Riahul,
Here it is
CREATE proc [dbo].[SBO_SP_RESTRICTBP]
@object_type nvarchar(25), -- 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'
-
-- ADD YOUR CODE HERE
-
-- Select the return values
if (@object_type = '13') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.GroupNum FROM OCRD T0 Where T0.GroupNum != 4 and T0.GroupCode != 116 and T0.UserSign = 16 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
SET @error = 30
SET @error_message =N'You are not authorized to change payment terms and customer group'
end
END
end
GO
Hi,
You may try:
IF (@object_type = '2') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.CardCode FROM OCRD T0 Where (T0.GroupNum != 4 or T0.GroupCode != 116) and T0.UserSign = 16 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
SET @error = 30
SET @error_message =N'You are not authorized to change payment terms and customer group'
End
END
Thanks,
Gordon
Hi Try this........
IF (@object_type = '2') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.CardCode FROM OCRD T0 Where (T0.GroupNum <> 4 And T0.GroupCode <> 116) and T0.UserSign = 16 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
Select @error = -1,
@error_message ='You are not authorized to change payment terms and customer group'
End
END
Regards,
Rahul
Hi ........
Try this......
IF (@object_type = '2') and (@transaction_type IN ('A', 'U'))
BEGIN
IF exists (select T0.CardCode FROM OCRD T0 Where (T0.GroupNum != 4 And T0.GroupCode != 116) and T0.UserSign = 16 and T0.CardCode =@list_of_cols_val_tab_del)
Begin
Select @error = -1,
@error_message ='You are not authorized to change payment terms and customer group'
End
END
Regards,
Rahul
User | Count |
---|---|
98 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.