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

transaction notification

I Have here may transaction notification, how can i exempt from this rule a "cancel doctatus"

thanks

--Duplicate Lab ID Reference Not Allowed

if @object_type = '17' and (@transaction_type= 'A' or @transaction_type= 'U')

begin

declare @LabID as varchar(200)

select @LabID = U_Lab_ID from RDR1 where docentry =@list_of_cols_val_tab_del

if 1 != (select count(docentry) from RDR1 with(nolock) where U_Lab_ID = @LabID)

begin

select @error = -3

select @error_message = 'Duplicate Lab ID Reference Not Allowed!'

end

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 10, 2016 at 07:46 AM

    Try this

    if @object_type = '17' and (@transaction_type= 'A' or @transaction_type= 'U')

    begin

    declare @LabID as varchar(200)

    select @LabID = U_Lab_ID from RDR1 where CANCELED='N' and docentry =@list_of_cols_val_tab_del

    if 1 != (select count(docentry) from RDR1 with(nolock) where U_Lab_ID = @LabID)

    begin

    select @error = -3

    select @error_message = 'Duplicate Lab ID Reference Not Allowed!'

    end

    Add a comment
    10|10000 characters needed characters exceeded

    • Try this

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

      begin

      declare @LabID as varchar(200)

      select @LabID = t0.U_Lab_ID from RDR1 t0 inner join ORDR t1 on t0.Docentry=t1.Docentry where t1.CANCELED='N' and t1.docentry =@list_of_cols_val_tab_del

      if 1 != (select count(docentry) from RDR1 with(nolock) where t0.U_Lab_ID = @LabID)

      begin

      select @error = -3

      select @error_message = 'Duplicate Lab ID Reference Not Allowed!'

      end

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.