7 Replies Latest reply on Aug 25, 2014 12:47 PM by KarenR

    Portal Line Items Not Populating Correctly From Popover

    KarenR

      Title

      Portal Line Items Not Populating Correctly From Popover

      Post

           So I'm customizing the "Invoices" starter solution for my sales orders, and I've populated the Products records with several products. I have also added some custom fields. Now when I click on the "Add Line Item" popover all my products are listed, which is great. But here is my issue:

             
      1.           When I click on any other than the first item in the popover, it populates the first item anyway on the Invoices record in the portal.
      2.      
      3.           If I try and add another line item, it just repopulated the first line item so only one is ever listed in the portal.

           I have the portal set to use the "Invoice Data" records and the Popover is using the "All Products | Popover" records, just like in the template. Please help!

        • 1. Re: Portal Line Items Not Populating Correctly From Popover
          philmodjunk

               When you click a button inside the row of a portal, this action does two things:

               It performs the action specified for your button and it sets the focus on the portal row that was clicked.

               What you describe is typical of a script that inadvertently loses the focus on the clicked portal row and then steps that refer to date in the portal's table refer to the first related record--which is most often the first record shown in your portal.

               Commit records is a common culprit here, but not the only way your script might "lose focus".

          Caulkins Consulting, Home of Adventures In FileMaking

          • 2. Re: Portal Line Items Not Populating Correctly From Popover
            KarenR

                 Phil - thanks for the reply. Not sure what you mean by "commit records". How do I fix it?

            • 3. Re: Portal Line Items Not Populating Correctly From Popover
              philmodjunk

                   Commit Records is a script step that might appear in your script. If it's not in your script, it's not the culprit. I suggest posting your complete script so that others can see it.

                   To post a script to the forum:

                     
              1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
              2.      
              3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
              4.      
              5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              6.      
              7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
              • 4. Re: Portal Line Items Not Populating Correctly From Popover
                KarenR

                     I see, yes it shows "Commit Records/Requests [No dialog]". I've uploaded a screenshot here.

                • 5. Re: Portal Line Items Not Populating Correctly From Popover
                  philmodjunk

                       and there's a commit records script step right there in line 4 of your script as I had suggested might be the culprit here.

                       But this also seems a very complex script just for clicking a portal row. And I see no script step in it that refers to "All Products | Popover"--which would seem to be the table occurrence specified for your portal.

                       I assumed that you had a portal to all products inside your popover and that clicking a row in the portal was supposed to add a new Invoice Data record linked to the current invoice and linked to products by setting the needed match field to the productID from "All Products | Popover".

                       Is that what is supposed to take place here?

                  • 6. Re: Portal Line Items Not Populating Correctly From Popover
                    KarenR

                         Yes, as I said I was just customizing the template that came with Filemaker Pro 13. So I didn't write it like that. I just compared the script to the one from the original version of the template and it matches exactly. 

                         

                              I assumed that you had a portal to all products inside your popover and that clicking a row in the portal was supposed to add a new Invoice Data record linked to the current invoice and linked to products by setting the needed match field to the productID from "All Products | Popover".

                         

                              Is that what is supposed to take place here?

                         Yes but it looks like the way the template was set up, it's using "New Product | Popover".

                    • 7. Re: Portal Line Items Not Populating Correctly From Popover
                      KarenR

                           I think I think I may have figured it out, it's looking at "Item" in the looked up products but I need it to look at "Customer SKU" since that's my new unique field.....