12 Replies Latest reply on Dec 7, 2012 4:06 PM by jon_n_davidson

    How Do I Handle the Backshash Character In Finds

    jmci

      In my current project I have a script that imports a flat file of legacy data and creates new records in various tables in the current database. The first step is to create new Company records. The Company::Name field is defined to be unique. My script saves the contents of the legacy company name field to a variable, goes to the new Company layout and performs a find to see if a record already exists with the same name:

       

      Enter Find Mode

      Set Field [ Name ; "==" & $companyName ]

      Perform Find

      If [ Get ( FoundCount ) = 0 ]

      New Record/Request

      Set Field [ Name ; $companyName ]

      Commit Records/Requests [No Dialog ]

      Endif

       

      My problem is that several records in the legacy table contain the backslash () character in the company names. Whenever my script performs a find to identify an existing record with the same Name it doesn't find the contents of the variable because, I assume, the backslash character escapes the character following it. Since the script hasn't found an existing record with the same Name, it creates a new record and the validation fails because the Name field is not, in fact, unique. Any suggestions?

       

      JMcI