Skip to Content
author's profile photo Former Member
Former Member

All address fields are mandatory

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 06:38 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 07:30 AM

    Thank you so much.

    Suresh Yerra.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.