on 2019 Oct 25 4:12 PM
I need to place control to allow duplicate Vendor Ref No. in Sales Order for all BPs but 1
Exception is ABC100
if @object_type='17' and @transaction_type in ('A','U')
begin
if not exists ( select numatcard from ORDR where docentry=@list_of_cols_val_tab_del and (CardCode in ('ABC100') and NumAtCard not in (select distinct NumAtCard from ordr)) or (CardCode not in ('ABC100') ) )
begin
set @error=1
set @error_message='Only Non Duplicate Customer Ref. No. for this BP'
end
end
Hi Krishnam Mathur,
Slightly Changed. check this code.
if @object_type='17' and @transaction_type in ('A','U')
begin
if exists ( select numatcard from ORDR where docentry=@list_of_cols_val_tab_del and (CardCode <>'ABC100') and NumAtCard in (select distinct NumAtCard from ordr))
begin
set @error=1
set @error_message='Only Non Duplicate Customer Ref. No. for this BP'
end
end
Regards,
Chella
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, I would change this:
(CardCode <>'ABC100')
to this:
(CardCode NOT IN (select CardCode from OCRD where QryGroup1 = 'Y'))
Replace QryGroup1 with the appropriate BP property, and set that property for any BP that this functionality is needed for.
User | Count |
---|---|
94 | |
9 | |
8 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.