cancel
Showing results for 
Search instead for 
Did you mean: 

Manage duplicate inventory sbo

Former Member
0 Kudos

Hi expert,

how can i manage duplicate inventory in sbo.?

For e.g. there is one item like Demo item.

Thenafter i add new item which is same name.

How can it alert me same item name will be already exits.?

Plzz. Help me asap.

Thanks,

Nikunj

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Nikunj,

try the below code. this will help you.

If @object_type = '4' and @transaction_type in ( 'A','U')

BEGIN

declare @ItmG int

declare @name char(100)

Select @name=I.ItemName,

       @ItmG=I.ItmsGrpCod

  From OITM I

  Where  I.ItemCode=@list_of_cols_val_tab_del

If exists (Select I.ItemName From OITM I

  Where I.ItemCode!=@list_of_cols_val_tab_del

        and I.ItmsGrpCod=@ItmG 

    and I.ItemName=@name     )

Select @error =12,

    @error_message = 'Duplicate Item Name!'

END

This code will allow you to stop from entering the duplicate item number in the same itemgroup.

Let me know if you need more information.

Thanks and regards,

Ravi.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please check this thread

Thanks.

KennedyT21
Active Contributor
0 Kudos

Try This

If @object_type = '4' and @transaction_type in ('A', 'U')

BEGIN

  if exists

   (

Select I.ItemName From OITM i

  Where I.ItemCode=@list_of_cols_val_tab_del and itemname  IN ( SELECT Itemname FROM oitm ) 

     )

Select @error =12,

    @error_message = 'Not Authorised'

END

rgds

Former Member
0 Kudos

Hi,

thanks for ur support.

bt i used above code in TN.

but now it will create a new problem.

i can't add new inventory which is a different name or same name.

it will give me message 'Not Authorised'.

Thanks,

Nikunj

KennedyT21
Active Contributor
0 Kudos

Try This

If @object_type = '4' and @transaction_type in ( 'A','U')

BEGIN

declare @name char(100)

Select @name=I.ItemName

  From OITM I

  Where  I.ItemCode=@list_of_cols_val_tab_del

If exists (Select I.ItemName From OITM I

  Where I.ItemCode!=@list_of_cols_val_tab_del

  

    and I.ItemName=@name     )

Select @error =12,

    @error_message = 'Duplicate Item Name!'

  end

Former Member
0 Kudos

Hi,

i facing same issue again.

i can't add new item which is a same name or different name.

plzzz. Give me better idea ASAP.

Thanks,

Nikunj

KennedyT21
Active Contributor
0 Kudos

I tested the same its working fine...

KennedyT21
Active Contributor
0 Kudos

Close the Thread with the correct and helpful answers

Regards

Kennedy

former_member212181
Active Contributor
0 Kudos

Hi Nikunj,

You can add a validation through Transaction notification in SQL.

Thanks & regards

Unnikrishnan

Former Member
0 Kudos

Hi,

I write below query in transaction notification but it will generate error.

select @error, @error_message

F @transaction_type IN ('A', 'U') AND

(@Object_type = '4')

begin

if exists (SELECT T0.[ItemName] FROM OITM T0 WHERE T0.[ItemCode] = T0.[ItemCode])

begin

select @Error = 10, @error_message = 'Item Name already exists...'

end

end

end

former_member212181
Active Contributor
0 Kudos

Hi Nikunj,

Please try below TN Query

If @object_type = '4' and @transaction_type in ( 'A','U')

BEGIN

If exists (Select I.ItemName From OITM I

Where I.ItemCode!=@list_of_cols_val_tab_del

   and I.ItemName=

   (Select ii.ItemName From OITM ii

     Where  ii.ItemCode=@list_of_cols_val_tab_del)  )

begin

select @error =12

select @error_message = 'Duplicate Item Name!!'

end

END

Thanks

Unnikrishnan

Former Member
0 Kudos

Hi,

thanks for ur support.

bt i used above code in TN.

but now it will create a new problem.

i can't add new inventory which is a different name or same name.

it will give me message 'Item Name already exists...'.

Thanks,

Nikunj