9 Replies Latest reply on Aug 18, 2017 12:24 PM by justinc

    Auto-complete in calculation window erases previous word


      This is a weird one.  I'm using FMPA 16.02 to edit a hosted file.


      I have been doing a lot of refactoring on a layout after making a new T.O. and rebasing an existing layout on the new T.O.  This has involved a lot of manual editing of calculations, e.g. Hide conditions, etc.  I have attached a little screen capture showing the erroneous erasure happening.  This problem has survived a program closing/opening (FM itself, not just the file).  I have NOT been able to replicate it in a new file, however.  It is highly repeatable in this one file in question, though.


      I noticed after a bit that sometimes I would lose a leading word when replacing the table name in the calculation.  This is in the case of a clause that has multiple logical tests connected with "OR" or "AND".  Here's an example calculation:

      Get( WindowMode ) = 1

      or cur_PROJ TALENT::show_Photo = 0

      or  cur_PROJ TALENT::NotAvail = 0


      In this case I was replacing "cur_Proj Talent" table name with "Lists_Anchor".  I would use the option-Delete and option-backspace to delete the existing table name.  I would then start typing the new name and the calculation auto-complete pop-over would show up with suggestions.  I would type enough to get close and then hit the Tab key to accept the current selection.  But when I hit Tab it would erase the word "OR" and the start of the line.


      If I had two spaces between the "OR" and the table name I was replacing, then it would NOT erase the leading word.   You can see this in the video - I have added a 2nd space between the "OR" and the table name before doing a replace.


      In the video I replace the instance in the first line without any incident.  At around the 4 second mark I start editing the 2nd line in the calculation, which is when the odd bits start.  At around the 7 second mark you can see as I delete the table name and start typing the new one, then at the 9 second mark the new table name I want is shown and highlighted.  The only thing I do after it is highlighted is to hit Tab - I didn't use the mouse for anything, nor use option-Delete nor cmd-Delete to remove anything - just hit the Tab key.  At which point it deletes the leading word "OR" from the start of the line.  The 3rd line goes off without a hitch because I added (for demonstration and testing purposes only) a second space between the words.


      I have made some light attempts to recreate this in another file but haven't been able to.

        • 1. Re: Auto-complete in calculation window erases previous word

          A minor update:  If the clauses are all on one line (instead of the separate lines that I was showing), the extra word still gets erased.  So, if this is the starting calculation (all on one line):

               LISTS_anchor::hidden_flag ≠ 1 or cur_Proj Talent::NotAvail = 1


          When I refactor the "cur_Proj Talent" table name in the second clause to "lists_Anchor", the "OR" that precedes it will get erased.

          • 2. Re: Auto-complete in calculation window erases previous word



            Thank you for your posts.


            I am unable to reproduce the issue with FileMaker Pro Advanced 16.0.2 under both macOS Sierra 10.12.6 and Windows 10 accessing a hosted file.


            Do you recall what version of FileMaker Pro was used to create the file?


            If the file is not hosted, does the issue also occur?


            If you open the file locally, and then go to File -> Save a Copy As...   and make a copy of the current file, does the resulting file also have the issue?



            FileMaker, Inc.

            • 3. Re: Auto-complete in calculation window erases previous word

              I too wasn't able to re-produce it on a new file created in 16.02.


              I don't know what version of FM was used to create this file - it has been around for quite a while.


              I had an older local copy of this file that I tested with:

                   Non-Hosted:  yes, problem occurs

                   Save-As-> Clone:  yes problem occurs in resulting file


              Something else I did notice was that it appears to be Table (or T.O.) specific.  When I am making the auto-complete replacements the leading "Or" word will only get erased/replaced when selecting certain table occurrences.  For instance, if I pick "TO_Bob" from the list, it will get erased.  But if I pick "TO_Sue" it won't.  (These two T.O.s are based on different tables.)


              I also noticed that it appears that ANY T.O. of a certain base-table will cause it to be erased.


              The base-table that is causing the erasures in this case happens to have a space in the name (e.g. "Table One").  So I did some testing with another table (in the same file) that also has a space (e.g. "Table Two") and it did not cause the erasure.


              It appears to think that the leading "Or" is part of the table name being replaced, in some cases, and thus it sucks it up when auto-completing.  The same issue doesn't happen if I have the leading word as "And".  I don't have any T.O.s in this solution that start with "Or " (note the trailing space), nor with "Or" for that matter.  (Oh wait!  I did find and instance where "and" was replaced.)


              I have a cut-down copy of this file I can send you if you want.  I removed all the layouts and made a simple layout with 1 object on it; the Hide Condition on this object is a good place to test this issue.  I left all the T.O.s in place so that you can use the same ones I'm using.


              --  Justin

              • 4. Re: Auto-complete in calculation window erases previous word



                I definitely would like the "cut-down copy" of the file.  I have sent you a private message with instructions where to send the file.



                FileMaker, Inc.

                • 5. Re: Auto-complete in calculation window erases previous word

                  Email and file were sent.


                  But, while composing it I was just noticing that the auto-complete is highlighting the two words that I have separated by a space, but in different parts of the results.  It appears to be taking the word "OR" as part of the words that it needs to find in the suggestions - they are highlighted in blue text in the suggestions.  (They words don't appear to have to be in that particular order - these two words can be anywhere in the resulting suggestion.)  I noticed that after I start typing "CUR" it highlights both "CUR" and "OR" in the suggestion.  And thus, when I pick that selection it is replacing both.

                  So my original calculation was:

                       0 or Bookmarks::name


                  If I want to replace "Bookmarks" with "CurrentSort" I would select the current "Bookmarks" and start typing "CUR":

                       0 or Cur::name

                  (You have to imagine that this is during the auto-complete process - the above is not the final result.)


                  The auto-complete would search for BOTH "OR" and "CUR" in the possible list of results and it would, in this case, find both string-chunks in "CurrentSort".  And so, when I hit tab to select the result, it is replacing both "OR" and "CUR" from my entry with the result, even though the leading "OR" really wasn't intended to be part of my entry.  So it would result in:

                       0 CurrentSort::::name



                  So…it would appear to be working correctly, just not quite as I would expect it to, or want it to work.  Maybe it could be tweaked to not include certain keywords, e.g. OR or AND?  I'm sure that there are others who do want it to work the way it currently is, though. 


                  If I put a CR in the calculation string after the OR, it doesn't get included in the suggestions and replacement.










                  --  J

                  • 6. Re: Auto-complete in calculation window erases previous word

                    And that explains why putting two spaces between "OR" and the T.O. name doesn't have this problem - the FM calc engine for auto-replace only looks across a single space.

                    • 7. Re: Auto-complete in calculation window erases previous word



                      File has been received.  Thank you.


                      I can reproduce the issue on both macOS Sierra 10.12.6 and Windows 10.


                      All information has been sent to Development and Testing for review.  When I receive any feedback, I will let you know.



                      FileMaker, Inc.

                      • 8. Re: Auto-complete in calculation window erases previous word



                        Testing is able to replicate the issue in FileMaker Pro 16.  The issue does not occur under FileMaker Pro 15.  All information has been sent to Development for further review.



                        FileMaker, Inc.

                        • 9. Re: Auto-complete in calculation window erases previous word

                          Cool, thanks for the update.