on 03-31-2011 4:20 AM
Hi,
I please need a transaction notification to prevent users from using the same bar code on more than one item i.e. barcode xyz may only appear once in the codebars field in oitm.
Thanks
Jacques
I assume you want to allow the empty bar code field.
Then nsert this in your SBO_SP_TransactionNotification stored procedure after the line
-- ADD YOUR CODE HERE
If @object_type = '4' and @transaction_type in ( 'A','U')
BEGIN
declare @B nvarchar(16)
set @B=(Select isnull(I.CodeBars,'') From OITM I
Where I.ItemCode=@list_of_cols_val_tab_del)
If @B!='' and exists
(Select I.CodeBars From OITM I
Where I.CodeBars=@B and I.ItemCode!=@list_of_cols_val_tab_del)
Select @error =12, @error_message = 'Duplicate bar code !!'
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Ended up using this below as I got a (220001) error with your code.
Thanks for you assistance, though.
-- Prevent Duplicate Bar Codes
If @object_type = '4' and @transaction_type in ( 'A','U')
begin
if exists ( select a.ItemCode from oitm a inner join OITM b on a.CODEBARS
= b.CODEBARS
and a.ItemCode <> b.ItemCode
where @object_type = '4' and
a.ItemCode = @list_of_cols_val_tab_del AND a.CodeBars
= b.CodeBars and a.ItemCode!=b.ItemCode)
begin
set @error = 9
set @error_message = 'BK-Duplicate Barcode.'
end
end
User | Count |
---|---|
103 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.