cancel
Showing results for 
Search instead for 
Did you mean: 

All address fields are mandatory

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Petr Verner ,

Thank you so much. But i don't know how to work with that stored procedure. please u help me on this and can u help me where can i get information on how to work with stored procedure.

Thanks,

Suresh Yerra

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you so much.

Suresh Yerra.