cancel
Showing results for 
Search instead for 
Did you mean: 

Validation in outgoing payment with Bank charges

former_member229757
Participant
0 Kudos

Hi Experts,

I Need a validation query to block outgoing payment- if bank charges is given in OP then UDF(Bank)) field is mandatory.

Thanks

Ram

Accepted Solutions (0)

Answers (2)

Answers (2)

SonTran
Active Contributor
0 Kudos

HI,

Try this Transaction Notification

IF @object_type = '46' and @transaction_type in ('A', 'U')
BEGIN	
	IF EXISTS (SELECT 1 FROM OVPM T0 
		WHERE isnull (T0.BcgSum,0)<>0 and isnull(T0.U_UDF,'')='' and T0.DocEntry = @list_of_cols_val_tab_del
		)
	BEGIN
		SET @error = 4601
		SET @error_message = N'Bank charge exists, input info into UDF!'
	END

END<br>

Hope this helps,

Son Tran

narayanis
Active Contributor
0 Kudos

Hi,

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

Begin

Declare @BnkChg Decimal (19,2);

Declare @BnkUDF nvarchar(100);

Select @BnkChg = IsNull(T0."BkChgAmt",0) , @BnkUDF = IsNull(T2.CounterRef,'') from OBCG t0

inner join OCRD T1 on T1."CardCode" = T0."CardCode"

INNER JOIN OVPM T2 ON T2."CardCode" = T1."CardCode" AND T2.DocEntry = @list_of_cols_val_tab_del;

If(@BnkUDF = '')

Begin

Set @Error = '-202';

Set @error_message = 'Please Enter An Information.';

End

End

For testing, header level reference field is taken. You can change this.Note: - I don't find any link between obcg and ovpm tables apart from cardcode. Please check all the scenarios.