Transaction Notification to Prevent Duplicate Barcodes

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

Similar Messages

  • SP Transaction Notification Check for Duplicate NumAtCard

    Hi,
    I have the following code in the SP.  It works fine for the A/P Invoice but it's not working for the Good Receipt PO.  Any idea ?
    -- A/P Invoices
    if @object_type = '18' and (@transaction_type in ('A' ,'U'))
    begin
          if (@object_type = '18')
                begin
                    select @RefNo = NumAtCard, @CardCode = CardCode from OPCH T0 where docentry = @list_of_cols_Val_tab_del
                    begin
                      if (@RefNo is not null)
                         begin
                           if 1 != (select count (docentry) from OPCH  where (NumatCard = @RefNo) and (cardcode = @CardCode))
                              begin
                                  select @error = -1
                                  select @error_message = 'La référence (NumAtCard) exist déjà'
                              End
                           End
                      End
                End
    End
    -- A/P Good Receipt
    if @object_type = '20' and (@transaction_type in ('A' ,'U'))
    begin
          if (@object_type = '20')
                begin
                    select @RefNo = NumAtCard, @CardCode = CardCode from OPDN T0 where docentry = @list_of_cols_Val_tab_del
                    begin
                      if (@RefNo is not null)
                         begin
                           if 1 != (select count (docentry) from OPDN  where (NumatCard = @RefNo) and (cardcode = @CardCode))
                              begin
                                  select @error = -1
                                  select @error_message = 'La référence (NumAtCard) exist déjà'
                              End
                           End
                      End
                End
    End

    Hi Marc
    Maybe something like this?
    declare @RefNo varchar(100)
    set @RefNo = (select isnull(NumAtCard,'') from dbo.OPDN where DocEntry = @list_of_cols_val_tab_del)
    if exists (select * from dbo.OPDN where isnull(NumAtCard,'') = @RefNo and DocEntry != @list_of_cols_val_tab_del)
    begin
         set @error...
    end
    Check if didn't make any typos. Anyway it should give you the idea;)
    Kind regards
    Radek

  • Preventing duplicate supplier reference

    Forum,
    On SAP B1 2007A B1 SP15 - is there a setting which would prevent/warn users from being able to duplicate the 'supplier reference' field on AP Invoice?
    I know there's a setting under 'Document Settings' in 8.8 and above. I can't locate this on 2007A.
    Regards,
    Juan

    Rahul,
    Upon checking further, there are 2 companies in total. One of the companies warns users when the supplier reference is duplicated. The other does not. Neither have the option mentioned in previous threads under document settings for AP Invoices?
    I have compared the SP Transaction Notification for both companies and both are standard and are identical??
    Regards,
    Juan

  • Unique Value Transaction Notification

    Hi Experts
    I have a problem in Transaction Notification
    I have a one UDF and i dont want to repeat the value . so i want to restrict if the value has repetead then system block me to add the sales invoice .
    my code is
    If @transaction_type = 'A' And @object_type = '17'
    Begin
    if exists (
    select u_dd_amt from ordr a where exists
    (select 1 from ordr where u_dd_amt =
    a.u_dd_amt)
    and  u_dd_amt =
    @list_of_cols_val_tab_del
    Begin
         select @error = 1, @error_message = 'Duplicate value not allowed in DD Amount field'
       end
    end
    the always error msg occured whenever i type any valye in UDF field please help me

    Buen dia Douglas,
    No es posible realizarlo ya que como tu indicas no tiene un Objtype, para poder realizar un transaction debe existir un Objtype.
    Saludos,
    Wuilmer venegas

  • Prevent duplicate production orders in MB1A

    Hello,
    Is there a way to prevent duplicate production orders being entered while posting goods issue to production through transaction MB1A?
    Sincerely,
    Ketan

    You can use MIGO for goods issue against production order and enter only one order to post the GI.
    Thx
    Anand

  • Easiest way to identify/delete/prevent duplicate documents

    I don't suppose that the text column (e.g. CLOB) is something that I can use the usual trick to delete duplicates with, is it? I would think rather than compare the actual text column, I'd need to calculate a checksum or something for each document and then delete rows with duplicate checksums. Or is there a better way? I'm trying to prevent, for example, a news article getting inserted 10 times because it's a UPI story that was carried by 10 different sites.
    Thanks.

    Your idea of a checksum is a good one. But I'd compute the checksum, and make it a unique constraint, which would PREVENT duplicates from being inserted. It's usually better to prevent them than to clean them up later.
    Tom Best

  • SBO_Post Transaction Notification

    SBO_Post Transaction Notification
    Hi Experts!,
    I´d like to get information about this Stored Procedure, can somebody give me any link, papers, etc?
    Regards,
    Ronald

    Hi Ronald ,
    Files are located in SBO_Knowledge_village group and below i paste is the link ,
    Jimmy Michael (See top contributors Gordon,Suda,..Jimmy) is the moderator of the form .Ask him to join you in this group . You can acess more documentation .
    http://tech.groups.yahoo.com/group/SBO_Knowledge_Village/files/Files/
    Thank you
    Bishal

  • Outgoing Payment Transaction notification...

    Hi all,
    I designed the following Transaction notification for outgoing payment.It is working well If doctype is 'C' or 'S'. I want to do this for Doctype 'A'. But not successful....
    Waiting for your replies..
    IF @transaction_type = 'A' AND @object_type = '46'
    BEGIN
    --If exists (SELECT T0.docentry  FROM OVPM T0 where t0.docentry = @list_of_cols_val_tab_del and T0.cashsum>=20000000)
    --     begin
    --          SET @error = 10
    --          SET @error_message = N'You cannot Pay Cash More than Rs. 2000/-'
    --     end
    If not exists (SELECT T0.docentry  FROM OVPM T0  where t0.docentry = @list_of_cols_val_tab_del and
    (((t0.cardcode like '%%VDLI%%' or t0.cardcode like '%%CDLI%%' ) and t0.Series = '61' and (t0.doctype = 'S' or t0.doctype = 'C'   ))
    or ((t0.cardcode like '%%VAHD%%' or t0.cardcode like '%%CAHD%%' ) and t0.Series = '64' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
    or ((t0.cardcode like '%%VMUM%%' or t0.cardcode like '%%CMUM%%' ) and t0.Series = '63' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
    or ((t0.cardcode like '%%VLDH%%' or t0.cardcode like '%%CLDH%%' ) and t0.Series = '66' and (t0.doctype = 'S' or t0.doctype = 'C' ))
    or ((t0.cardcode like '%%VKOL%%' or t0.cardcode like '%%CKOL%%' ) and t0.Series = '62' and (t0.doctype = 'S' or t0.doctype = 'C' ))
         begin
              SET @error = 11
              SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
         end
    END
    Regards
    Deepak tyagi

    Hi Deepak,
    Try this way:#
    if @object_type='46'
    BEGIN
          IF @transaction_type='A' OR @transaction_type='U'
          BEGIN
                DECLARE @OPCHDocEntry int
                DECLARE @OPCHDocType nvarchar(1)
                 SET @OPCHDocEntry = CAST(@list_of_cols_val_tab_del as int)
                SET @OPCHDocType = (SELECT DocType FROM OPCH WHERE DocEntry=@OPCHDocEntry)
            IF @OPCHDocType in ('S','C')
                BEGIN
                    If not exists (SELECT T0.docentry  FROM OVPM T0  where t0.docentry = @list_of_cols_val_tab_del and
                                  (((t0.cardcode like '%%VDLI%%' or t0.cardcode like '%%CDLI%%' ) and t0.Series = '61' and (t0.doctype = 'S' or t0.doctype = 'C'   ))
                                  or ((t0.cardcode like '%%VAHD%%' or t0.cardcode like '%%CAHD%%' ) and t0.Series = '64' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
                                  or ((t0.cardcode like '%%VMUM%%' or t0.cardcode like '%%CMUM%%' ) and t0.Series = '63' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
                                  or ((t0.cardcode like '%%VLDH%%' or t0.cardcode like '%%CLDH%%' ) and t0.Series = '66' and (t0.doctype = 'S' or t0.doctype = 'C' ))
                                  or ((t0.cardcode like '%%VKOL%%' or t0.cardcode like '%%CKOL%%' ) and t0.Series = '62' and (t0.doctype = 'S' or t0.doctype = 'C' ))
                        begin
                                            SET @error = -1000
                                            SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
                        end
                END
             IF @OPCHDocType ='A'
             BEGIN
               If not exists  (SELECT T0.docentry FROM OVPM T0 INNER JOIN VPM4 T1 ON T0.DocEntry = T1.DocNum and t0.docentry = @list_of_cols_val_tab_del and
                                                 (t1.acctcode like '%%ADLI%%' and t0.Series = '61' and  t0.doctype = 'A' and T1.LocCode = '1' )
                                                 or (t1.acctcode like '%%AAHD%%' and t0.Series = '64' and  t0.doctype = 'A' and t1.LocCode = '2' )
                                                 or ( t1.acctcode like '%%AMUM%%' and t0.Series = '63' and  t0.doctype = 'A' and t1.LocCode = '3' )
                                                 or ( t1.acctcode like '%%ALDH%%' and t0.Series = '66' and  t0.doctype = 'A' and t1.LocCode = '5')
                                                 or ( t1.acctcode like '%%AKOL%%' and t0.Series = '62' and  t0.doctype = 'A' and t1.LocCode = '4')
                BEGIN
                            SET @error=-1001
                            SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
            END   
          END
    END
    END
    Thanks,
    Neetu

  • How to Prevent duplicates on Combination of Lookup columns in sharepoint 2010 using infopath 2010 form.

    Hi All,
    I have list with some Lookup columns like  City, Pin, and Text Column Name. All these are required columns.
    Now I want to prevent duplicates while submitting InfoPath form if a Combination of  City,Pin & Name. (like a Composite primary in Database is used.)
    Can some one help me on how to achieve this using InfoPath  2010 Rules, writing  rule in Xpath.
    Thanks in Advance.

    1. Add a secondary data connection to the list where the form will be submitted.
    2. Prior to submit via rules, set the query fields in the above connection: City, Pin & Name with values entered in the form. Query the data source and check if the result has values.
    3. Show error messages accordingly if exists else continue with Submit.
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Transaction Notification for Restrict user to delere row but new item addition will allowed in Production Order

    Dear All Experts,
    My client having some custom requirement in Production Order.
    1) When Production Order will created and its status will released then it will allowed user to update any quantity of any items or add any new items but it will not allowed to delete any items from row level.
    2) When any item will be deleted then our transaction notification will be raised.
    I created one Transaction Notification Code but it will restricted to update anything or delete.
    IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '202'
    BEGIN
    Declare @VisOrder1 nvarchar(255)
    Set @VisOrder1=(SELECT Top 1 T1.VisOrder+1 FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry 
    WHERE (T0.Status = 'R' and T1.VisOrder=(select TOP 1 VisOrder from wor1 where DocEntry=@list_of_cols_val_tab_del order by VisOrder Desc)))
      If @VisOrder1 >0
      begin
      SET @error = 231
      SET @error_message =  'You have not rights to delete any Item - Please Contact System Administrator ' + @VisOrder1
      end
    END
    Please help me for solve this problem.
    I wait for your warm replay.
    Thanks & Regards,
    Nishit Makadia

    Hi,
    Please check these threads. Let me know your feedback.
    http://scn.sap.com/thread/3518208
    http://scn.sap.com/thread/3545101
    Thanks & Regards,
    Nagarajan

  • Need advice on preventing duplicate entries in People table

    Hi,
    In my database, I have a "People" table where I store basic information about people e.g. PersonId, FirstName, LastName, Gender, etc.
    There will be lots of entries made into this table and I want to prevent duplicate entries as much as humanly possible. I'd appreciate some pointers on what I should do to minimize duplicates.
    My primary concerns are:
    Duplicate entries for the same person using the person's full name vs. given name e.g. Mike Smith and Michael Smith
    Making sure that two separate individuals with identical names do get entered into the table and get their unique PersonId's.
    Not even sure how I can even possibly know if two individuals with identical names are two different people without having additional information but I wanted to ask the question anyway.
    Thanks, Sam

    Thank you all very much for your responses.
    There are three separate issues/points here.
    It is clear that it is impossible to prevent duplicates using only a person's first, middle and last names. Once I rely on an additional piece of information, then things get "easier" though nothing is bullet proof. I felt that this was self evident but
    wanted to ask the question anyway.
    Second issue is "potential" duplicates where there are some variations in the name e.g. Mike vs Michael. I'd like a bit more advice on this. I assume I need to create a table to define variations of a name to catch potential duplicates.
    The third point is what Celko brought up -- rather nicely too :-) I understand both his and Erland's points on this as typical relational DB designs usually create people/user tables based upon their context e.g. Employees, Customers, etc.
    I fundamentally disagree with this approach -- though it is currently the norm in most commercial DB designs. The reason for that is that it actually creates duplicates and my point is to prevent them. I'm going for more of an object based approach in the DB
    design where a person is a person regardless of the different roles he/she may play and I see no reason in repeating some of the information about the person e.g. repeating first, last name, gender, etc in both customer and employee tables.
    I strongly believe that all the information that are directly related to a person should be kept in the People table and referenced in different business contexts as necessary.
    For example, I assign every person a PersonId in the People table. I then use the PersonId as part of the primary key in the Customers or Employees table as well. Obviously, PersonId is also a foreign key in Customers and Employees tables. This prevents the
    need for a separate CustomerId and allows me to centralize all the personal data in the People table.
    In my opinion this has three advantages:
    Prevent duplication of data
    Allow global edits e.g. if the last name of a female employee changes, it is automatically updated for her within the context of "Customer" role she may play in the application.
    Last but not least, data enrichment where a person may enter additional data about himself/herself in different contexts. For example, in the employee context, we may have the person's spouse information through "Emergency Contacts" which may come handy
    within the context of customer for this person.
    Having everyone in the People table gives me these three advantages.
    Thanks, Sam

  • Preventing duplicates in Aperture?

    I'm using the Import function (not dragging from the Finder) JPG photos and I have the box checked "do not import duplicates" - yet when I import files into the same project I'm getting duplicates and they are the exact same file name.  Is there some other setting I need to have checked or this a bug - does anyone know?  It is definitely creating a lot of manual work to try and get rid of the duplicates once I've completed the import.  Thanks for any help anyone can provide. 

    If you import from the same card into the same project, then it shouldn't duplicate. That said, this functionality is imperfect.
    The best way to prevent duplicates is to not continually import the same files. When you import, you have the ability to choose what files you import; you should only select new files.

  • Transaction Notification with DI Server

    Hello
    I am developing a Web Site with the DI Server, when I have validations in the Transaction Procedure the error  message is incorrect.
    Message: Could not commit transaction.
    Transaction Notification
    set @error='10'
    set @error_message = 'SP: 123'
    -- Select the return values
    select @error, @error_message
    end
    I made the test with the DI - API  and the message is correct.
    Exists a workaround for this problem???
    Thanks
    Regrats
    Edited by: Andres Naranjo on Sep 1, 2010 1:25 AM

    Hello
    This problem was solved in SAP Business One 8.8 PL20.
    Regards

  • Approval procedure vs Transaction Notification

    Hello dear experts,
    I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
    this is the scenario and conditions to consider:
    1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
    2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
    I realized that the approval procedure is launched before the Transaction Notification SP.
    So I decided to add a query for the approval procedure considering the validations in the project column:
    SELECT distinct 'true'
    FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99   ---This part works perfeclty!!!
    AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0  )  --This part does not work
    As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
    Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
    I appreciate any help on this. Thank you very much
    Regards,
    Mary

    Hi,
    You must use both in approval procedure or use both in SBO store procedure transaction notification.
    To request approval for a project, you this following approval query:
    if (SELECT $[$38.31.0]) > ' '
    select 'true'
    the other query is for doctotal approval as follows:
    if ($[opor.doctotalsys.number]) between 0 and 24999.99
    SELECT 'true'
    or
    select distinct 'true' FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
    Both are able to use and work simultanously.
    JimM

  • Transaction Notification for Blocking Batch

    Dear Experts,
    I am facing a critical situation. My Client wants to Block the material movement  if it is not inspected through Quality Personal. I have already Locked batches through General Settings > Inventory > Batch Status . But it only blocks the batches for Goods Issue and Receipts Transactions. It is not working in case of Inventory transfers.
    I have created UDF on GRPO called U_InspStatus where by default value is Pending once the Quality personal changes the UDF value to Completed then only the batch should be able to move through Inventory Transfer.
    Can anyone help me in creating Transaction Notification on Inventory Transfer Document  which can block batches if there status is pending ?
    Waiting for your replies.
    Regards,
    RK

    Hi Naga,
    Please find below mentioned answer to your queries -
    1. Inventory transfer done by means of posting inventory transfer document? - Yes
    2. Inventory transfer as applicable to customer not vendor. How do you select vendor in inventory transfer document? - Not selecting the customer in Inventory Transfer document not required I am moving material from one warehouse to another.
    3. How did you update inspection status in inventory transfer document - Inspection status is updated in Quality Add on and not in Inventory Transfer. But if I am transferring material from one warehouse to another without Inspection then it should block the batch whose Inspection status is pending.

Maybe you are looking for

  • How can I organize playlists within a folder?

    I want to use iTunes to burn an MP3 cd containing a number of albums by one artist. I name the Folder after the artist, and then create a few of playlists within that folder (into which I import each album.) But if I name each playlist after the albu

  • Help! the changes on my book were gone when i opened iphoto

    i just finished my 100 page book! I opened my computer and the 100 pages that I made had a days work all gone. I saved it as a pdf though. I want to order it, but i cant open the pdf file in iphoto. how do i go about ordering the book based on pdf fi

  • IBook G4 won't load after latest security update, repair doesn't work?

    Hi I had the same problem as someone else in this forum: "Last night I saw that my ibook G4 wanted to do a security update. I told it to do it, and the ibook has not started since. It reset itself after downloaded, but it just stays on the booting up

  • Greyed out menubar irems with CS5

    A couple of days ago when I opened PS there was no splash screen and the menubar appeared immediately. Up until that time I had no problems. All of the items in the pulldowns are greyed out, and I am now unable to use PS at all. Drag and drop to the

  • TS4223 i want to buy and HD movie but only show in SD on my appletv (ie: Wreck it Ralph)

    Say I buy an early release movie in HD, but my bandwidth at home is ok, but several people share it, so on my AppleTV I want the SD version to stream and not HD, how do I do this?