cancel
Showing results for 
Search instead for 
Did you mean: 

SP_Transaction notification for Cash account non negative value

Former Member
0 Kudos

Hi I wrote the following SP_Transaction notification when cash account is going negative in outgoing payment.its working fine in 2005B.

But it is not working in 2007B.pl any one help me.

IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'46')

BEGIN

if Exists ( select t0.currtotal from oact t0 inner join ovpm t1 on t0.AcctCode=t1.CashAcct

where t0.currtotal <=0 and t1.docentry=@list_of_cols_val_tab_del)

BEGIN

SELECT @Error = 1, @error_message = 'Cash account should not be negative!'

END

END

Edited by: ArulPrakasan P on Nov 21, 2008 1:42 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try with this

IF (@transaction_type = 'A' or @transaction_type = 'U') AND @Object_type = '46'

BEGIN

if Exists ( select t0.currtotal from oact t0 inner join ovpm t1 on t0.AcctCode=t1.CashAcct

where t0.currtotal <=0 and t1.docentry=@list_of_cols_val_tab_del)

BEGIN

SELECT @Error = 1, @error_message = 'Cash account should not be negative!'

END

END

Former Member
0 Kudos

Hi Gerardo Ham,

The above suggested you also not working. i don't think

IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'46')

and

IF (@transaction_type = 'A' or @transaction_type = 'U') AND @Object_type = '46'

makes much difference.

Former Member
0 Kudos

maybe the reason is that docentry is integer and @list_of_cols_val_tab_del is nvarchar(255). Try the condition change to

docentry = convert(int, @list_of_cols_val_tab_del)

Former Member
0 Kudos

Hi peter,

Thanks, the above suggested by you also not working.

finally i have restored the 2005B database ,then it got upgraded to 2007B,then i tried to add the out going payment with the above SP_transactionnotification. now its working fine and am getting the error message.

but i guess some problem in 2007B version for the sp_transactionnotification

Edited by: Rui Pereira on Apr 29, 2009 1:53 PM

reno1
Active Participant
0 Kudos

Hi

Try using Cast ( @list_of_cols_val_tab_del as int).

This should help in resolving your issue.

Regards

Reno

Answers (1)

Answers (1)

ladislav_meszaros
Contributor
0 Kudos

Hi ArulPrakasan,

The provided code functions properly under 2007B version on my test system. I receive the error message

(1) 'Cash account should not be negative!' after trying to confirm outgoing payment when cash account is going negative.

Have you received any error messages under 2007B version?

Regards,

Ladislav

SAP Business One Forum Team

Former Member
0 Kudos

No , ia m not getting any error message in 2007B.

then i tried the following... I restored the 2005B database to 2007B.then it got upgraded to 2007B,then i tried to add the out going payment with the above SP_transactionnotification.

now i got the following error msg...

[microsoft] [sql native client] [sql server] : conversion failed when converting the varchar value '@list_of_cols_val_tab_del' to datatype int

Edited by: ArulPrakasan P on Nov 24, 2008 9:14 AM

Edited by: ArulPrakasan P on Nov 24, 2008 9:15 AM