on 10-05-2020 4:24 PM
Hi Community,
I need to place a control on AR reserve Invoice. They should be based on a Sales Order.
Regular AR Invoice should not get affected. I wrote below code but there is an error
if @object_type = '13' and @transaction_type in ('A','U') begin if not exists ( select t0.DocNum from oinv t0 inner join inv1 t1 on t0.DocEntry=t1.DocEntry where t0.DocType='I' and t0.isIns='Y' and t0.CANCELED <>'C' and t1.BaseType='17' and t0.DocEntry=@list_of_cols_val_tab_del --and t0.UserSign<>'4' ) begin set @error=1 set @error_message = 'AR Reserve Invoice should be based on SO' end end
Hi,
Try this query,
if @object_type = '13' and @transaction_type in ('A','U')
begin if exists
( select t0.DocNum from oinv t0 inner join inv1 t1 on t0.DocEntry=t1.DocEntry where t0.DocType='I' and t0.isIns='Y' and t0.CANCELED <>'C' and t1.BaseType <>'17' and t0.DocEntry=@list_of_cols_val_tab_del )
begin
set @error=1
set @error_message = 'AR Reserve Invoice should be based on SO'
end
end
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
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.