9 Replies Latest reply on Oct 17, 2016 4:10 PM by philmodjunk

    Add record to a Portal not working in Filemaker Go 15

    wildwood28

      Hi,

      I have a script that adds a new record to a portal...it works fine on Filemaker 15 on my PC, but won't work on Filemaker Go 15 on the ipad.

       

      Strangely, it does still work perfectly with Filemaker Go 13.

       

      Basically it works for the first entry and creates the new entry in the portal ready for data to be entered, but then when the script is run again, it locates the curser in the previously created record and overrides it.

       

      However, it does create a new record which shows on the PC, and when you go out of the layout on the iPad and go back it, the new record then shows.

       

      I checked the compatibility for IOS in the script workspace but nothing shows as being a problem.

       

      So I am guessing there is a step that isn't compatible with the new version...it doesn't know to go to the newly created record which should be showing in the Portal.

       

      I have attached a copy of the script.

       

      Hoping it is something easy to fix!

        • 1. Re: Add record to a Portal not working in Filemaker Go 15
          philmodjunk

          Your Description of the problem is a bit confusing because the script itself does not interact with the portal object at all.

           

          I switches to a layout, presumably one based on the portal's table and creates the new record there before returning. By "overrides it" what exactly do you mean? Do you see the quantity inserted into the wrong record? Or something else?

           

          The script you show is patterned after one that is long used. It's main potential issues are a) It can trip a number of script triggers on a number of layout objects and b) it loses the focus on a particular portal row when the script returns to the original layout and the portal can even "snap" back to an unscrolled position, but it should create the correct new record in the portal's table if your portal is to an occurrence of inventory WG and Customer ID is the sole field used to link records in your portal's relationship to the customers table occurrence.

           

          I'd check for script triggers that might perform a script that interferes with this process. Note that your "insert calculated result" is probably better replaced with set field, though there is a very small chance that it might be an issue here as it can also trip script triggers on the Inventory WG layout.

          • 2. Re: Add record to a Portal not working in Filemaker Go 15
            wildwood28

            Hi! Thank you for getting back to me so quickly!

             

            I wrote this script a few years ago, and it still works fine on Filemaker Go 13, but the same script doesn't go to the new record in Filemaker Go 15...it overides the previous one in the portal despite a new record correctly being created in the actual table.

             

            Basically, it goes from the customer info layout..in which there is the inventory portal showing what products the customer has... to the actual Inventory WG table layout, creates a new record, inserts the Customer ID and Qty, then returns to the portal so the user can enter further details.

             

            It works fine on my PC using Filemaker Advanced 15, and no errors show when I debug.

             

            On Filemaker Go 15, instead of going to the new record in the portal, it puts the cursor into whatever is at the top and overrides it.

             

            If I go out of the layout and back in again, the new record then shows in the portal.

             

            So something is happening between going from the Inventory WG table, back to the portal but it is only on the latest version of Filemaker Go.

             

            I tried removing the "insert Calculated Result" but it didn't help.

             

            There are no script triggers set on either layout.

             

            I have used variations of this script elsewhere in my database and the same thing is happening.

             

            Its a mystery!

            • 3. Re: Add record to a Portal not working in Filemaker Go 15
              philmodjunk

              It is still not clear from your description what you mean by "overrides it". Please describe exactly what you mean by that phrase.

               

              This is a very commonly used method for creating new records in a portal. I'd expect to see a lot of bug reports if it suddenly did not work.

               

              So I did my own test. I found I had to create a new file for this as I have stopped using this method in my recent solutions as I prefer another approach.

              Add Related Record.png

              When I use FM GO 15 on my iPhone, to test this scripted method. It works perfectly for me. I see a new record with "apple" in the "avalue" field appear in the portal each time I tap a button that performs this script.

              • 4. Re: Add record to a Portal not working in Filemaker Go 15
                Markus Schneider

                seems that the script does not go to the 'lineitems-table', but 'goes' to the portal record via customer_id -> resulting in overwriting the first record

                -> if there is no existing 'lineitems' record: Does it create a new one?

                 

                Why it works on desktop... no idea

                • 5. Re: Add record to a Portal not working in Filemaker Go 15
                  philmodjunk

                  Mi Markus,

                   

                  If you read his script, it's nearly identical to mine. He is not actually "going to the portal row"--which is what I thought before I actually looked at his script and found the standard "Switch layout" method in his script.

                   

                  That leaves the "override" term vague to me when I read his descriptions of the issue.

                  • 6. Re: Add record to a Portal not working in Filemaker Go 15
                    Markus Schneider

                    #%^#}

                     

                    When reading postings from the in-box (at least on iOS, I only have the iPad here), then there is NO attachement visible on the start-posting )-:

                     

                    I can see that by going to the 'real' posting, but not when reading via in-box

                     

                    Sorry!

                     

                    (You got to be pretty technical, these days -- Johnny Mnemonic)

                    • 7. Re: Add record to a Portal not working in Filemaker Go 15
                      wildwood28

                      Hi,

                      Hopefully this might help as to what I mean about overriding

                       

                      Here is an image of what should happen when the Add New Record script is run...this is in Filemaker Go 13 (and what also happens in Filemaker 15 Advanced on my PC.

                       

                       

                      New-Record-working-Filemaker-Go-13.jpg

                      And this is what happens in Filemaker Go 15...the cursor goes to the top record and there is no sign of the newly created record...however, the new record is created in the actual table and if I go out of this layout and back in again, the new blank record then shows in the portal.

                       

                      New-Record-overriding.jpg

                       

                      Hope that makes sense!

                       

                      What I can't work out is why it works on the older Filemaker Go version, and on the most recent desktop version...but not on the latest Filemaker Go!

                      • 8. Re: Add record to a Portal not working in Filemaker Go 15
                        wildwood28

                        Hi!

                         

                        Tried using this script with my variables in my database, and this is where it gets even stranger - it now works on Filemaker Go 13 and 15...but not on the desktop!

                         

                        Weird!

                        • 9. Re: Add record to a Portal not working in Filemaker Go 15
                          philmodjunk

                          you've got some other stuff going on here. I don't think that this has anything specific to do with the script, but perhaps due to changes in FM GO as to what gets the focus as different events take place. My very simple test does not attempt to set the focus into a portal row or a field in the portal row and thus this would not be something that my first test checked on.

                           

                          I've seen other reports that indicate that a behavior change in this area took place. What value list format did you specify for the brand field? Popup menu or popup list?

                           

                          What layout object was named "WG Hangers"?