cancel
Showing results for 
Search instead for 
Did you mean: 

Message not print in Transaction notification Stored Procedures

Former Member
0 Kudos

Hi

I added my code in stored procedures name of [dbo].[SBO_SP_TransactionNotification].

but whenever i add new sale order it will not give me proper message instead of it display show in image.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please post your stored procedure here to check.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Nagarajan,

i can share my SP.

USE [DatabaseName]

GO

/****** Object:  StoredProcedure [dbo].[SBO_SP_TransactionNotification]    Script Date: 11/21/2014 10:07:02 ******/

SET ANSI_NULLS ON

GO

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 = '17' and @transaction_type = 'A'

begin

  if (select ORDR.NumAtCard from ORDR

  where ORDR.DocEntry = @list_of_cols_val_tab_del) is null

  begin

--------------------------------------------------------------------------------------------------------------------------------

-- Select the return values

  set @error = -5001

  set @error_message = N'Please Enter Value'

  end

  end

end

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this:

IF @transaction_type in ('A') AND (@OBJECT_TYPE='17')

BEGIN

If exists (select T0.DocEntry from ORDR  t0 where T0.DocEntry =  @list_of_cols_val_tab_del and T0.[NumAtCard] is null)

Begin

SET @error = 10
SET @error_message = 'Please enter Customer PO'

End

End

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Nagarajan,

as per your scenario i try it but it will does not print message like

'Please Enter Customer PO'

instead of it will display message like,

(-1) Stored procedure SBO_SP_TransactionNotification must return a value

Former Member
0 Kudos

Hi,

It seem to SP not placed correct position. SP must be placed in correct way and looks like attached screen shot.

As per Nagarajan query, copy and paste it in correct location and you will get the desired error.

Regards,

Dilli Babu S

Former Member
0 Kudos

Hi Dillibabu,

I got solution as per your scenario that whenever i click on add button it will generate error.

But my actual scenario is that :

I have created Four UDF in SO.

1) After i add new SO by click on add button then it will added and when i re-open it then it give me some value in UDF but it cannot store it db, after i make minor changes to re-open SO then it store it's value.

2) so for that every time i click Shift + F2 and it give me value.

can i use for that transaction notification for UDF.?

Regards,

Nikunj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nikunj,

I think you have deleted this query in your transaction notification page. Kindly paste this at last of your transaction notification page.

select @error, @error_message

end

With regards,

BHARATHIRAJA