Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Marketing Document Block

$
0
0

Hi ArunRaj R.....

 

 

Try the Below

 

/* Start */

if @transaction_type in ('A', 'U')

and @object_type in ('23','17','15','16','203','13','14')

begin

    if exists(

        --Sales Quotation

        select DocEntry

        from OQUT with (nolock)

        where @object_type = '23'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

        union all

        --SO

        select DocEntry

        from ORDR with (nolock)

        where @object_type = '17'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

        union all

        --DO

        select DocEntry

        from ODLN with (nolock)

        where @object_type = '15'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(U_SO_TRANS_TYPE,'') = ''

        union all

        --Return

        select DocEntry

        from ORDN with (nolock)

        where @object_type = '16'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

        union all

        --A/R DP

        select DocEntry

        from ODPI with (nolock)

        where @object_type = '203'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

        union all

        --A/R Invoice

        select DocEntry

        from OINV with (nolock)

        where @object_type = '13'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

        union all

        --A/R Credit Memo

        select DocEntry

        from ORIN with (nolock)

        where @object_type = '14'

            and @list_of_key_cols_tab_del = N'DocEntry'

            and DocEntry = @list_of_cols_val_tab_del

            and isnull(OWNERCODE,'') = ''

    )

    begin

        set @error = -1

        set @error_message = ' Owner code Type must be filled'

    end

end

/* End */

 

 

Hope helpful

 

Regards

Kennedy


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>