Javascript to check for duplicate entries in 2 pull-down lists

I have created an application form in Acrobat 8 Professional, using LiveCycle and would like to compare selections in 2 drop-down lists so that the same option is not selected twice. I think this is something that could be done with javascript, but my experience with scripting is limited to typing the word scripting. Will someone please provide step-by-step instructions for a newbie? Thanks!

The attached sample compares the selected value from two drop-down lists.
// form1.page1.subform1.dd1::exit - (JavaScript, client)
if (!(form1.page1.subform1.dd1.isNull)) {
  var stooge = form1.page1.subform1.dd1.rawValue;
  stooge = stooge.toLowerCase();
  if (!(form1.page1.subform1.dd2.isNull)) {
    var stooge_ = form1.page1.subform1.dd2.rawValue;
    stooge_ = stooge_.toLowerCase();
    if (stooge == stooge_) {
      xfa.host.messageBox("You have picked the same Stooge from each list.");
// form1.page1.subform1.dd2::exit - (JavaScript, client)
if (!(form1.page1.subform1.dd2.isNull)) {
  var stooge = form1.page1.subform1.dd2.rawValue;
  stooge = stooge.toLowerCase();
  if (!(form1.page1.subform1.dd1.isNull)) {
    var stooge_ = form1.page1.subform1.dd1.rawValue;
    stooge_ = stooge_.toLowerCase();
    if (stooge == stooge_) {
      xfa.host.messageBox("You have picked the same Stooge from each list.");
I am multitasking so beware.
Steve

Similar Messages

  • Check for Duplicate Credie Memos

    Hi ,
    We have set up the Duplicate invoice check for our company code.
    Also, in the vendor master we have the " Chk. duplicate invoice " activated. This should check both the invoices and credit memos for duplicate entries.
    However, the same is not working in the case of credit memos and all the parameters such as company code , reference and the invoice date are same for both the credit memos ( even the amount and other parameters ). In the documentation, it is mentioned that this would work for both the invoices and credit memos.
    Still the system does not issue a warning message for the same.
    Can anyone suggest .
    Thanks,
    Srikanth.

    Hi,
    lease check the below OSS note:-
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=31771]
    [http://help.sap.com/saphelp_afs30b/helpdata/en/ce/4f3e39ea3aee02e10000000a114084/content.htm]
    Regards,
    Gaurav

  • Problem in Set Check for Duplicate Invoices

    Hi,
    I have did all the required setting s for check duplicate invoice , but when i do miro , its not giving any error or warning msge.. i did all the config  as per blw link..
    FYI-  in migo, i have entered the 3434 as a invoice ref # in delveriy note column and while doing miro , i have entered 3434 in ref column and give the 3434 as a dlvery note # in item tab .. but its not giving any error?
    Pls guide, where the mistake has gone wrongly??
    Problem in Set Check for Duplicate Invoices
    Edited by: UJ on May 15, 2009 1:45 PM

    Hello,
    Hope you have done all the required configurations for the checking of double invoice and ticked the vendor for the double invoice checking in vendor master record.
    You have to understand the way the system does the double invoice check.
    As per the configuration, if the system identifies an invoice for a vendor whose double invoice check is activated, at the time of MIRO, system will update a separate table.
    So system will check for the double invoice entry among the invoices entered after making the tick in the vendor master.
    i meant to say that, if you are introducing this double invoice check in between the transactions, the check will be valid only for the invoices entered after the activation of double invoice check.
    Regards

  • Set Check for Duplicate Invoices.

    Hi,
    what is the difference if is set "<b>Set Check for Duplicate Invoices</b>"
    in MIRO?
    Best regards

    HI,
    This check will prevent incoming invoices being accidentally entered and paid more than once.
    You can choose whether to activate or deactivate the check criteria of company code, reference document number and invoice date for each company code. The more criteria that you activate, the lower the probability of the system finding a duplicate invoice.
    The company code check makes sense if you work with more than one company code.
    Depending on the reference document number entry, the system checks as follows:
    1. If you have entered a reference document number, the system checks whether the invoice matches in the following attributes:
    Company code
    Vendor
    Currency
    Invoice date
    Reference document number
    2. If you have not entered a reference document number, the system
    3. checks whether the invoice matches in the following attributes:
    Company code
    Vendor
    Currency
    Invoice date
    Amount in
    document currency
    Depending on the system settings, a warning message or an error message appears if the system finds an invoice that matches all attributes.
    Requirements
    The field Chk double inv. (Check for duplicate invoice) must be flagged on the Accounting view in the vendor master record.
    Regards
    Aasif

  • OBA5 : Error Message for duplicate entry

    Hi
    In Tcode OBA5 - i enter F5 as Apllication area and i select new entries - i Enter 117 - and i Enter E before i save.
    but when i go to MIRO to check if there is an error message for duplicate entry, i find just a Warning Message !
    Please did i forget any thing ? please advise.
    Thank You,

    Hello,
    OBA5 should be enough, but you must remenber that the following fields must be identical for duplicate invoice check:
         Company code                           (BUKRS)         
         Vendor number                           (LIFNR)         
         Currency                                    (WAERS)         
         Reference number                       (XBLNR)         
         Amount in document currency      (WRBTR)         
         Document date                           (BLDAT)         
    Note 305201 is also helpful.
    Cheers

  • Check for duplicate record in SQL database before doing INSERT

    Hey guys,
           This is part powershell app doing a SQL insert. BUt my question really relates to the SQL insert. I need to do a check of the database PRIOR to doing the insert to check for duplicate records and if it exists then that record needs
    to be overwritten. I'm not sure how to accomplish this task. My back end is a SQL 2000 Server. I'm piping the data into my insert statement from a powershell FileSystemWatcher app. In my scenario here if the file dumped into a directory starts with I it gets
    written to a SQL database otherwise it gets written to an Access Table. I know silly, but thats the environment im in. haha.
    Any help is appreciated.
    Thanks in Advance
    Rich T.
    #### DEFINE WATCH FOLDERS AND DEFAULT FILE EXTENSION TO WATCH FOR ####
                $cofa_folder = '\\cpsfs001\Data_pvs\TestCofA'
                $bulk_folder = '\\cpsfs001\PVS\Subsidiary\Nolwood\McWood\POD'
                $filter = '*.tif'
                $cofa = New-Object IO.FileSystemWatcher $cofa_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
                $bulk = New-Object IO.FileSystemWatcher $bulk_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
    #### CERTIFICATE OF ANALYSIS AND PACKAGE SHIPPER PROCESSING ####
                Register-ObjectEvent $cofa Created -SourceIdentifier COFA/PACKAGE -Action {
           $name = $Event.SourceEventArgs.Name
           $changeType = $Event.SourceEventArgs.ChangeType
           $timeStamp = $Event.TimeGenerated
    #### CERTIFICATE OF ANALYSIS PROCESS BEGINS ####
                $test=$name.StartsWith("I")
         if ($test -eq $true) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("L")
           $tempItem=$left.substring(0,$pos)
           $lot = $left.Substring($pos + 1)
           $item=$tempItem.Substring(1)
                Write-Host "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\CofA.csv -Append -InputObject "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"
                start-sleep -s 5
                $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=PVSNTDB33; Initial Catalog=adagecopy_daily; Integrated Security=TRUE")
                $conn.Open()
                $insert_stmt = "INSERT INTO in_cofa_pvs (in_item_key, in_lot_key, imgfileName, in_cofa_crtdt) VALUES ('$item','$lot','$name','$timestamp')"
                $cmd = $conn.CreateCommand()
                $cmd.CommandText = $insert_stmt
                $cmd.ExecuteNonQuery()
                $conn.Close()
    #### PACKAGE SHIPPER PROCESS BEGINS ####
              elseif ($test -eq $false) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("O")
           $tempItem=$left.substring(0,$pos)
           $order = $left.Substring($pos + 1)
           $shipid=$tempItem.Substring(1)
                Write-Host "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\PackageShipper.csv -Append -InputObject "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"
    Rich Thompson

    Hi
    Since SQL Server 2000 has been out of support, I recommend you to upgrade the SQL Server 2000 to a higher version, such as SQL Server 2005 or SQL Server 2008.
    According to your description, you can try the following methods to check duplicate record in SQL Server.
    1. You can use
    RAISERROR to check the duplicate record, if exists then RAISERROR unless insert accordingly, code block is given below:
    IF EXISTS (SELECT 1 FROM TableName AS t
    WHERE t.Column1 = @ Column1
    AND t.Column2 = @ Column2)
    BEGIN
    RAISERROR(‘Duplicate records’,18,1)
    END
    ELSE
    BEGIN
    INSERT INTO TableName (Column1, Column2, Column3)
    SELECT @ Column1, @ Column2, @ Column3
    END
    2. Also you can create UNIQUE INDEX or UNIQUE CONSTRAINT on the column of a table, when you try to INSERT a value that conflicts with the INDEX/CONSTRAINT, an exception will be thrown. 
    Add the unique index:
    CREATE UNIQUE INDEX Unique_Index_name ON TableName(ColumnName)
    Add the unique constraint:
    ALTER TABLE TableName
    ADD CONSTRAINT Unique_Contraint_Name
    UNIQUE (ColumnName)
    Thanks
    Lydia Zhang

  • How do i check ensure that SAP checks for duplicate vendor invoice numbers?

    Hi Experts -
    How do I verify that SAP checks for duplicate vendor invoice numbers and blocks duplicate invoices from being paid?
    Thanks!

    Hi
    Pls chek the settigs by following the path
    IMG>Materials Management>Logistics Invoice Verification>Incoming Invoice>Set Check for Duplicate Invoice.
    Here you make the settings for creating a duplicate invoice check.
    Moreever, in the vendor master, you need to tick the check box for duplicate invoice check.
    I suggest you search the Forums before posting a query. There are lots of postings on this issue.
    Thanks & regards
    Sanil K Bhandari

  • Check for duplicate invoices and trigger a workflow

    Hello All,
        I have a requirement to check for duplicate invoices in AP(Accounts payable) and trigger a workflow when duplicate invoices are found. I a not sure how to do any of the above. Please  let me know if you have any information on:
    1) Checking for duplicate invoices in AP
    2) Trigger a workflow
    Are there any standard workflows that checks duplicate invoices?
    Thanks.
    --Mithun

    Hi MD,
    I doubt if system gives an error on FI side when a duplicate invoice is posted.
    I feel you would require a BAdi for it, where you can call your WF using FM SAP_WAPI_START_WORKFLOW.
    Hope it helps.
    Aditya
    P.S also ask your Func Consultants, if there are any settings in the Customization, where you could capture Inv Dt, Inv Amt, Vendor, Company code.
    Edited by: Aditya Varrier on Oct 15, 2008 9:38 AM

  • How to create a scenarios for duplicate entries

    Hi friends,
    Please help me how to create a scenarios for duplicate entries, we are using stock transfer orders from there we need to create scenarios for duplicate entries, please guide me on the same.

    Hi,
    F-01 can be used to create a sample document.
    Regards
    Aditya

  • How can I check for duplicates in Apple Photos?

    Can't use my existing apps to check for duplicates in Apple Photos as they only work with iPhoto folders. Any ideas how I can get around this gap?
    OS X 10.10.3

    Duplicate Annihilator for Photos:  http://brattoo.com/propaganda/#photos
    PowerPhotos: http://www.fatcatsoftware.com/powerphotos/

  • Override the storage section check for manual entries

    Hi All,
    I am facing a issue on Storage section search.While creating To system is giving correct Storage section according t the settings but if I would like  to change the storage section to different storage section system is not giving any error message.It is giving only warning message check your enteries.
    So I would like know is there is config settings to avoid another storage section selcetion which are not assignned storage search indicator.
    I have checked in help.sap.com .I following information .
    To set up the strategy for storage sections, see the section on activating storage section searches under Strategies in the Warehouse Management IMG documentation.
    If storage section checking is active for the storage type, then the system searches in the storage type only for those empty storage bins in storage sections that have been allowed for the material being put away. When you are creating a transfer order and manually enter a storage bin, then the system checks whether the bin is in a storage section that is allowed for the material.
    *You can also make an entry in customizing that permits you to override the section check for manual entries.*_
    Can please advice me inorder activate the config for override the section check for manual entries or any warning message.
    Thanks & regards,
    Srikanth

    HI,
    Thanks for your reply.
    I want Error message.
    Regards,
    Srikanth P

  • Does itunes check for duplicate purchases?

    I got a new version of itunes and I cannot have my purchased next to my new purchases.  Does itunes check for duplicates? Or are they happy to take your money?

    Maybe they will in a future update. Im not sure but I think they use to do this. IF they did Id say they stopped to make the record companys happy (And alittle richer)

  • GOS - check for duplicate Attachments

    Hi guys!
    Fianlly i managed it to add a URL to GOS in my abap program
    i used the following FMs
    CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
    CALL FUNCTION 'SO_OBJECT_INSERT'
    CALL FUNCTION 'BINARY_RELATION_CREATE'
    So what i do is running an abap report in a batch job which adds me the necessary urls.
    Now i need to now how i can check for duplicates in the gos. In particular check if this link is already there or not?
    who knows?
    thanks!!

    thank you, that helps me alot.
    Just one last thing,
    How can i find the URL value (the link actually) now?
    thanks!

  • Checking for duplicate primary keys on row inserts

    Checking for duplicate primary keys on row inserts
    I have a situation where I will be making bulk table inserts knowing that the primary key value will in some cases already exist. In this is the case I simply want to ignore the duplicate inserts.
    Should I be performing a sub-query on the table and using a statement like:
    where not exist in
    Or is there a cleaner way of discarding or checking for duplicates on insert.
    My concerns were mainly one of performance, as my routine will be inserting a few thousand rows in its operation.

    The MERGE commnad is a good option when a large percentage of the data will exist in the target because it is much more efficient to attempt to update then insert when the update affects zero rows than capture an error and convert it to an update.
    However, since in this case it would appear that only a few rows will alreadys exist and we want to ignore the duplicates when they exist then
    begin
    insert
    exception
    when dup_value_in_index then null;
    end
    would be the way to code this one. The bulk insert version has in 9.2 the ability to store the errors so that they can all be handled at once which means the rest of the array insert can work.
    HTH -- Mark D Powell --

  • How to check for duplicates - with a twist?

    As I'm importing music from my CD collection, is there a way to automatically check for duplicates - with an unusual twist?
    I already imported about 70 CDs using AAC format.
    I just bought a huge external drive specifically for storing my entire collection of CDs and LPs. Now that I have lots of space, I want to import everything in Apple Lossless format.
    Is there an automatic (or at least painless) way to check for duplicates as I'm importing CDs, and to have the old AAC music files over written by the new Apple Lossless files?

    Hi Clinto,
    Do you see the column headers above in itunes? They say Title, Album, Artist, etc. I don't know if it's the same for MAC but in Windows, Right Click on the column headers and click "Kind". This will display the format each song is in. If your column headers already take up all of your screen, you're gonna have to uncheck one to make room for "kind".
    Oh! and to overwrite existing files, make sure the ID3 tags are filled exactly to the old ones prior to ripping, though you don't need to fill all of them. I think you just fill the Artist, Album Artist, Album, and Title. A window will appear as you start to rip. It will ask if you want to overwrite the existing files, click "Yes". Again, don't know about Mac but it works this way in Windows.
    Message was edited by: fullcream

Maybe you are looking for