12 Replies Latest reply on Aug 19, 2017 2:30 AM by mz5005

    Script problem about flagging names

    mz5005

      I have two tables:

      A has many company names

      B has only IT companies

       

       

      B is a table from an external source that i want to use to flag all

      IT companies in A.

      script works fine, all properly flagged, exept for one issue.

       

       

      in A there is e.g IBM, but also IBM Canada and many other variations;

      only IBM is flagged, variations aren't.

       

       

      * tried to add in B an asterisk (IBM*) - doesn't help

      * tried to change the perform find from $Company to =$Company - doesn't help.

       

       

      manual says anyway that "Smith" finds also "Smithson" etc, so don't understand why

      it doesn't work in the first place.

       

       

      your input greatly appreciated!

        • 1. Re: Script problem about flagging names
          wimdecorte

          mz5005 wrote:

           

           

           

           

          * tried to add in B an asterisk (IBM*) - doesn't help

          * tried to change the perform find from $Company to =$Company - doesn't help.

           

           

           

          Can you show us the script steps you are using for this?

          • 2. Re: Script problem about flagging names
            danielfarnan

            I am guessing here, but does your script loop through the found records in table A or only flag the first record in the found set? Are you able to pause your script after it issues the Perform Find step and see how many records are found? Are you testing for an empty found set?

            • 3. Re: Script problem about flagging names
              mz5005

              Hi Wim, Daniel,

               

              @ Wim - will do, but let me first look if Daniel's guess solves the problem.

               

              @ Daniel - yes that is a good one. Now I remember I made that similar mistake before (only finding first value).

                                Will search how that was solved.

               

              Thanks for your help both!

              • 4. Re: Script problem about flagging names
                mz5005

                Checked it - and I think it is not the "only find first record issue" that Daniel mentioned.

                 

                So here you go, one pdf with the script and one screenshot with the PerformFind opened.

                Thanks for your ideas!

                 

                LargeCompany Search Script.pdf - Box

                LargeCompany Search Script_ PF opened.PNG

                • 5. Re: Script problem about flagging names
                  wimdecorte

                  Try to avoid specifying find requests inside the Perform Find script step.  It's hard to troubleshoot and not as readable as doing:

                   

                  Enter Find Mode (---> unselect 'pause' )

                  Set Field[ largeComapnies::Company ; $company ]

                  Perform Find[]  (---> no options selected)

                   

                  We don't see in your script where you flag or how you do in case you have multiple records in your found set.  Can you send a new screenshot that show that?

                   

                  As a total aside: do away with the "go to record [first] just before the find, it's irrelevant what record you are on when you start the search.

                  1 of 1 people found this helpful
                  • 6. Re: Script problem about flagging names
                    beverly

                    What Wim said.

                    Beverly

                    • 7. Re: Script problem about flagging names
                      mz5005

                      Thanks Wim and Beverly and sorry for the late reply - got flooded with work last days.

                       

                      I will try out what you say first, then give total feedback plus screenshot as requested.

                       

                      Einstein's quote is also true about FMP:

                      “The more I learn, the more I realize how much I don't know.”

                      • 8. Re: Script problem about flagging names
                        mz5005

                        !

                        Wim and others:

                        Changed the script to "your way" of using PerformFind.

                        (Deleted GoToRecord First also).

                         

                        Here you have the new script version attached, plus two

                        examples where it only partly works (a large company is

                        found, but not all occurrences).

                        The LargeCompany table on the right versus the Companies left.

                         

                        The flag you asked about:

                        the field Active is set to NO if Company is found in LargeCompany

                        (and made yellow with conditional format).

                        Otherwise Active is set to YES.

                         

                        I don't see any different spelling, comma's etc that could cause the problem.

                        Any other ideas? (just thought about hidden format signs?)

                         

                        Thanks for the ideas!

                        (PS am on buisness trip so reply might take a few days)

                         

                        Script with better Perform Find.pdf - Box

                         

                        Example A.PNG

                         

                        Example B.PNG

                        • 9. Re: Script problem about flagging names
                          wimdecorte

                          I'm not sure I follow those screenshots, the parts on the left are those the found set after doing a search?  If so is the only 'failure' the fact that the conditional format does not work?

                          • 10. Re: Script problem about flagging names
                            mz5005

                            Sorry late reply Wim, as said was on a trip.

                             

                            On the left you see ALL company (name) records. They are always yellow (and set to Not Active)

                            when they are recognised by the script as a Large Company from the LargeCompany table on the right.

                            (in case we run the script to omit the large companies).

                             

                            So Transcom is in the LargeCompany table...the conditional formatting works fine,

                            but Transcom Worldwide Inc., is NOT recognided as a LargeCompany, while all other Transcoms are.

                            (not yellow and still on Active is Yes).

                             

                            Similar occurences with other large companies. This causes you need to check the whole table by hand.

                            Any ideas what can cause this?

                            • 11. Re: Script problem about flagging names
                              wimdecorte

                              Not without looking at the actual data.  It could be a simple as a data issue where the string "Transcom" on the left contains non-visible characters, that would make your test fail.

                              • 12. Re: Script problem about flagging names
                                mz5005

                                OK understand.

                                I will copy those "should have been found but not" fields into a word doc

                                and switch on the hidden chars.