cancel
Showing results for 
Search instead for 
Did you mean: 

SP Notification

Former Member
0 Kudos

Hi

    I have a field at Header Level (Yes/No) in A/r Invoice Credit Note . I want when there is No in that field , G/L account in rows should not be '510000'

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jagjit.......

Try this....

If @object_type='14' and @transaction_type IN ('A','U')

BEGIN

If Exists (Select T0.DocNum from ORIN T0 INNER JOIN RIN1 T1

ON T0.DocEntry=T1.DocEntry

Where T1.AcctCode=510000' And T0.U_UDF Like 'N%%'

And T0.DocEntry = @list_of_cols_val_tab_del)

BEGIN

Select @error = -1,

@error_message = 'when UDF is 'No' in that field , G/L account in rows should not be '510000''

End

End

Replace UDF to your exact UDF code.....

Regards,

Rahul

Answers (2)

Answers (2)

former_member218051
Active Contributor
0 Kudos

Hi Jagjit,

IF(@object_type = '14') and (@transaction_type in ('A', 'U'))

Begin

     IF Exists (select ORIN.DocEntry from ORIN   inner join RIN1  on Orin.DocEntry = RIN1.DocEntry      where ORIN.DocEntry = @list_of_cols_val_tab_del and ORIN.U_UDFY_N  = 'NO' and     

     RIN1.AcctCode = '510000')

     Begin

          SET @error = 1

          SET @error_message = 'Please Change The G/L Account''

     End

End

Thanking you

Malhaar

Former Member
0 Kudos

HI

Try this SP,

IF(@object_type = '14') and (@transaction_type in ('A', 'U'))

begin

IF Exists (select T0.DocEntry from ORIN  t0 inner join rin1 t1 on t0.docentry = t1.docentry where T0.DocEntry = @list_of_cols_val_tab_del and t0.U_udf1  = 'NO' and t1.AcctCode = '510000')

Begin

SET @error = 1

SET @error_message = 'Document cannot be added with GL Account '510000''

End

End