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".
Phil - thanks for the reply. Not sure what you mean by "commit records". How do I fix it?
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:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- 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.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- 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.
I see, yes it shows "Commit Records/Requests [No dialog]". I've uploaded a screenshot here.
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?
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 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.....