Skip to Content

Mandatory fields

Hi,

I'm trying to set a field as mandatory at business partners but only for clients.

I want to modify the following instrucction but i don't know where must I insert the sentence , and T0.CardType = 'C'

IF @object_type = '2' and (@transaction_type in ('A' ,'U'))

BEGIN

if (SELECT (T0.LicTradNum) from OCRD T0 where T0.CardCode = @list_of_cols_Val_tab_del) is null

BEGIN

set @error = 300

set @error_message = 'Mandatory field'

END

END

Thank you.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 23, 2014 at 01:30 PM

    Hi,

    Try this:

    IF @object_type = '2' and (@transaction_type in ('A' ,'U'))

    BEGIN

    if exists (SELECT (T0.LicTradNum) from OCRD T0 where T0.CardType = 'C' and T0.CardCode = @list_of_cols_Val_tab_del)

    BEGIN

    set @error = 300

    set @error_message = 'Mandatory field'

    END

    END

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2014 at 01:46 PM

    Hi

    Try this


    IF @object_type = '2' and (@transaction_type in ('A' ,'U'))

    if (SELECT (T0.cardtype) from OCRD T0 where T0.CardCode = @list_of_cols_Val_tab_del)='C'

    BEGIN

    if (SELECT (T0.LicTradNum) from OCRD T0 where T0.CardCode = @list_of_cols_Val_tab_del) is null

    BEGIN

    set @error = 300

    set @error_message = 'Mandatory field'

    END

    END

    shachar



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2014 at 02:21 PM

    Hi,

    Did you check my query?

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2014 at 06:05 PM

    Hi Oscar,

    Please check below.

    if @object_type = '2' and @transaction_type in ('A','U')

    begin

    If Exists (Select cardcode FROM OCRD T0

    where (LicTradNum is NULL or LicTradNum = '' ) AND CardType = 'C' AND T0.CardCode = @list_of_cols_val_tab_del )

    Begin

    SET @error = 1003

    SET @error_message = N'Mandatory field'

    End

    End

    Hope this helps 😊

    --

    --

    Regards::::

    Atul Chakraborty

    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.