1 2 Previous Next 16 Replies Latest reply on May 23, 2015 7:59 AM by ajseper

    FM 13 Script not working in FM14?

    ajseper

      This script imports an Excel CSV file then checks and marks duplicates.

       

      Here is the Script:

       

      Screen Shot 2015-05-21 at 6.15.43 PM.png

       

      Now the parts:

      Screen Shot 2015-05-21 at 6.31.52 PM.png

      Screen Shot 2015-05-22 at 7.43.08 AM.png

      The FM 13 Results:

      Screen Shot 2015-05-22 at 7.19.37 AM.png

      The FM 14 Results:

      A blank greyed out screen. Clicking Delete All works but one does not see what they are deleting. I should mention that

      FM 13 is Advanced where as FM 14 is a trial. Should not make a difference?

       

      Does this mean that all FM13 files have to be confirmed that they will still function on FM14 if one were to upgrade?

      Screen Shot 2015-05-22 at 7.24.38 AM.png

       

      Also when Pausing a script the Continue button was HiLited in FM13, not so in Fm14. This subtacts from the UI/X.

       

      Suggestions/Comments Please.

        • 1. Re: FM 13 Script not working in FM14?
          richarddeshong

          Possibly add a Refresh Window() just before the Delete Records()?

          • 2. Re: FM 13 Script not working in FM14?
            siplus

            After line 19 (Adjust window),

            add a Refresh window and a Pause/Resume Script with 0 seconds as parameter.

             

            If you see the records now, before the dialog box comes in front, then try eliminating one of the 2 instructions I suggested, see if you still see the records.

             

            Looks like dialogs pop up turbofast, before screen refreshes naturally, and freeze everything - I had that too.

            • 3. Re: FM 13 Script not working in FM14?
              Markus Schneider

              can You provide the screenshot #1 with the window-title? FM14 says 'delete all 4 records' - but there are 6 records (Found count). Sounds like a missing refresh window as mentioned in other's postings

              • 4. Re: FM 13 Script not working in FM14?
                siplus

                And btw there are better ways to remove duplicates

                • 5. Re: FM 13 Script not working in FM14?

                  I think you'll find your loop works faster if you freeze the window before the loop so that FileMaker doesn't redraw the screen for the next records.

                   

                  Also is there really any reason to create a new window, I don't see why?

                   

                  Also move the adjust window step to before the sort. I've found that 14 is exhibiting some strangeness with window resizing, especially in Windows.

                   

                  v1 is always buggy and this is one reason why an experienced developer would only use v1 and v2 for testing prior to deployment when v3 arrives. There are numerous glitches that would make me wait before deploying a money making db into a v1 or v2 version. OK to buy. OK to use for testing. Wait to deploy. Rule of Thumb.

                   

                  One extra try is to make a slight change to the script, say add an extra line at the end and then save it. The script editor is a bit buggy and I have lines jumping up and down in the editor when I click on them. Messy...

                   

                  There are three lines that are worth adding when determining a found set and sorting it.

                   

                  Find

                  Sort

                  Scroll Window Home

                  Go to Record First

                  Refresh Window

                  • 6. Re: FM 13 Script not working in FM14?
                    erolst

                    siplus wrote:

                    And btw there are better ways to remove duplicates

                    "Not to mention" that the first subscript is superfluous.

                    • 7. Re: FM 13 Script not working in FM14?
                      ajseper

                      Thank You for all the replies. Will give them a go.

                       

                      The reason for creating a new window is that when going thru the process the users see all the records imported, the duplicate records deleted and the records added as a result of the import. Users like the feed back however, there may be better ways to achieve.

                      Deleting 4 duplicated records out of the 6 imported indicates that 2 new records were added.

                       

                      I am sure there are better ways to find duplicates. This is a brute force method as it compares all the fields(It can still screw up as the Broker does not provide time in the TransactionDate). Also Line 8 is not complete as including would make the script too small to read. Suggestions appreciated.

                      • 8. Re: FM 13 Script not working in FM14?
                        siplus

                        ajseper wrote:

                         

                        I am sure there are better ways to find duplicates. .... Suggestions appreciated.

                         

                         

                        Let's say you have a database with 600'000 records, 50'000 importable records, only 4 not being duplicates.

                        I can have these 4 displayed and ready to be imported in 12 seconds. (Being a "duplicate" means having the same value in a key field.) To me it's fast enough, given the record quantities.


                        The idea is to avoid searches on non-indexable fields, like unstored calcs that decide duplicates based upon self-relationships.

                         

                        STRUCTURE

                        In your database you have the real data table - TableA.

                        - you have a mirror table in the same database, TableB, with only one field indexed - the key field.

                        - there's a relationship between a global field in TableA and the key field in TableB.

                         

                        PROCEDURE

                        - delete all records in TableB then import all data into TableB.

                        - go into TableA, set the global to ExecuteSQL("SELECT ID FROM TableA";"";"")

                        - GTRR into table B based upon the relationship

                        - Find omitted.

                         

                        Now you have the non-duplicate records in TableB, ready to be imported in TableA.

                         

                        Here is a demo:

                        • 9. Re: FM 13 Script not working in FM14?
                          KevinMullins

                          jackrodgers wrote:

                           

                           

                          v1 is always buggy and this is one reason why an experienced developer would only use v1 and v2 for testing prior to deployment when v3 arrives. There are numerous glitches that would make me wait before deploying a money making db into a v1 or v2 version. OK to buy. OK to use for testing. Wait to deploy. Rule of Thumb.

                           

                           

                           

                          I understand what you are getting at, but I don't know that I would call version 14 of an application a v1.  Yes, there are a few bugs that don't get caught. And there might need to be a patch, hence the v1 status you are implying, but FM is a mature product and should be releasing more stable versions at this point in its maturity.  If they had a beta program, that is what I would call v1.  And after the beta program that release would be the v2.  Unfortunately, I think this is where financial targets and Devcon schedules get in the way of complete testing and facilitating the v1, v2, and v3 mentality.

                          • 10. Re: FM 13 Script not working in FM14?
                            Benjamin Fehr

                            siplus

                            I'm curious about that Pause / Resume Script [0 seconds] trick.

                            I use a minim. of 0,2 or 0,5 seconds.

                             

                            Once more sounds like Voodoo.

                            (which seem to be a common method with FMP)

                            • 11. Re: FM 13 Script not working in FM14?
                              Markus Schneider

                              it will provide kind of a 'hickup'.

                              I'm using half-second pause - also to display a specific state on FMGo because of the lack of debugging..: A script sets a single-$ var to a specific value, then a button-label in the main menu-bar (available in all layouts) will have a specific color depending on that value. This half second is long enough to recognize the color, telling me where the scripts are... let us do our work without debugging fields/vars on a layout - but when it crashes, we note the color...

                              • 12. Re: FM 13 Script not working in FM14?
                                siplus

                                It's like when you're driving and a genius is glued to your back. You gently touch the brake pedal without actually braking. The result is immediately visible

                                • 13. Re: FM 13 Script not working in FM14?
                                  Benjamin Fehr

                                  no doubt, it works √

                                  Conclusion: You need a Voodoo-Priest in your FMP Developer-Team

                                  • 14. Re: FM 13 Script not working in FM14?
                                    erolst

                                    siplus wrote:

                                    STRUCTURE

                                    - there's a relationship between a global field in TableA and the key field in TableB.

                                     

                                    PROCEDURE

                                    - delete all records in TableB then import all data into TableB.

                                    - go into TableA, set the global to ExecuteSQL("SELECT ID FROM TableA";"";"")

                                    - GTRR into table B based upon the relationship

                                     

                                    Is this faster than using the (non-calculated) key field on both sides with GTRR [ match found set ]?

                                    1 2 Previous Next