on 12-22-2008 6:34 AM
Dear All,
How to restrict the end user to add a BP without having atleast one Bill To address & Ship To Address. And all the fields in Bill To and Ship To address are mandatory.
I made address names are mandatory but i don't know how to work with address fields (ex: Block, City etc), why because the address fileds are same for both Bill to and Ship to.
How to solve this problem.
Thanks in advance.
Suresh Yerra.
The easiest way is using transaction notificiation stored procedure - when user operates with BP, check if in tables for Ship to and bill to adress are record which met your conditions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I explained it here many times, try search on the forum.
For your case is it as:
1. modify SBO_SP_TransactionNotification stored procedure on sql server (for 2005 - select db, programmability, stored procedures, select this one and right click modify)
2. Where is written something like Here add your code add
-- condition if is it for BP adding or updating
if @object_type = '2' and @transaction_type in (N'A', N'U')
begin
-- in variable @list_of_cols_val_tab_del is cardcode of BP
if 0 = (
select count(o.cardcode) from ocrd o with(nolock), crd1 c with(nolock) where o.cardcode = @list_of_cols_val_tab_del
and c.cardcode = o.cardcode and c.adresType = N'S' and
(c.City is not null and c.street is not null)-- here add other mandatory fields
)
begin
select @error =1
select @error_message = 'Wrong ShipTo adresses'
end
if 0 = (
select count(o.cardcode) from ocrd o with(nolock), crd1 c with(nolock) where o.cardcode = @list_of_cols_val_tab_del
and c.cardcode = o.cardcode and c.adresType = N'B' and
(c.City is not null and c.street is not null)-- here add other mandatory fields
)
begin
select @error =1
select @error_message = 'Wrong BillTo adresses'
end
end
to conditions add other fields you want to have mandatory.
Edited by: Petr Verner on Dec 22, 2008 8:07 AM
Thank you so much.
Suresh Yerra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.