4 Replies Latest reply on Jul 25, 2017 9:35 AM by expat_at_home

    Can you use a Multi Line Key in a Perform Find Script Step?

    asarakby

      Title

      Can you use a Multi Line Key in a Perform Find Script Step?

      Post

      I have used a multi line key in a relationship and it seems to work but I cannot seem to get it to work for a found set. any ideas?

       

       

       

       

      Thank You,

      Adib

        • 1. Re: Can you use a Multi Line Key in a Perform Find Script Step?
          LaRetta_1

          Hi Adib,

          You can't use a multi-line to search for individual values in another field because they would never be equal unless the target field holds all the values.  You need to loop through the items.  Use field global to hold the multiline in this example ... script could be:

          Enter Find Mode [ uncheck pause ]
          Exit Loop If [ Get ( RecordNumber ) > ValueCount ( data::global ) ]
          Set Field [ yourTextFieldToSearch ; GetValue ( data::global ; Get ( RecordNumber ) ) ]
          New Record/Request
          Exit Loop
          Set Error Capture [on ]
          Perform Find[]
          If [ not Get ( FoundCount ) ]
          Show Custom Dialog [ "No records found" ]
          Show All Records
          Go To Layout [ original layout ]
          Exit Script
          Else
          ... do whatever with the found set
          End If

          NOTE:  Using Get ( RecordNumber ) here works on find request numbers as well - just like many of the other Get(*) functions.  I could have also used Get ( FoundCount ) and it would have done the same thing since it would be counting the requests.

          • 2. Re: Can you use a Multi Line Key in a Perform Find Script Step?
            LaRetta_1

            I should mention that the opposite IS possible ... you can search using one value and find fields with a multiline and the value deep inside it.  Each line is treated as an individual record when searching.

            This treatment of multi-line fields can bite you.  If you have a text field with value of DELTA and you have two records: Record 1 has DELTA in it and record 2  has:

            Alpha
            Delta
            Foxtrot

            ... and you search for duplicates using ! ... FM will say that record 1 and record 2 are duplicates even though they are not. 

            • 3. Re: Can you use a Multi Line Key in a Perform Find Script Step?
              philmodjunk

              An alternative to multi-line keys that you might consider is to use a join table instead.

              • 4. Re: Can you use a Multi Line Key in a Perform Find Script Step?
                expat_at_home

                Hi,

                 

                Would you mind expanding a bit (or sharing a link) on how to use a join table for a find script?

                 

                Thanks!