nareyramos Posted October 14, 2013 Posted October 14, 2013 Hello. I have been able to export selected records to a portal in a related table before by including a specific Find criteria in a script, but now I'm trying to create a script that allows me to export a set of records selected after performing a Find with a specific criteria (search criteria NOT in script) to a portal in a related table and it is not working. Can somebody shed some light? Thanks. NR
Wim Decorte Posted October 14, 2013 Posted October 14, 2013 export selected records to a portal This bit does not make sense... export is to another file outside of FM. A portal is for displaying related records. Can you expand a bit on your description, what is it that you are trying to do, what kind of errors are you getting?
nareyramos Posted October 14, 2013 Author Posted October 14, 2013 I have two related tables. Table #1 has a portal (from Line Items Table) that I use to show records from Table #2. Now, if I go to Table #2, I want to be able to perform a Find with certain parameters and send the found set of records to my portal in Table #1 by clicking a button. I don't know how to write this script. I hope I make more sense now. Thank you. NR
comment Posted October 14, 2013 Posted October 14, 2013 See if this helps: http://fmforums.com/forum/topic/89857-portal-showing-found-set/?p=412279
Wim Decorte Posted October 15, 2013 Posted October 15, 2013 After the find in table 2, you are already looking at the found set, why would you then want to "transport" that found set to table 1 for looking at it? Seems like an unnecessary step.
nareyramos Posted October 15, 2013 Author Posted October 15, 2013 Wim: Table #1 is "Orders" and Table #2 is "Products". When I create a new order in Table #1, I select a client (no problem with that part) and then select the products this client is ordering in the portal (Line Items). There are hundreds of products and sometimes a client orders products from different categories in the same order. I don't want to manually select each product because it would be very time consuming. The best choice (I think) is to perform a Find in "Products" based on the client's request and "transport" the found set to the portal in Table #1. I don't have a problem with bringing to my portal all the products that are under a specific category. I was able to do that. My problem is when a client requests 3 out of 10 products from one category and 2 out of 12 products from another category and 6 out of 100 products from another category, etc. I have hundreds of categories and the process can be really tedious.
comment Posted October 15, 2013 Posted October 15, 2013 Table #1 is "Orders" and Table #2 is "Products". Do you also have a third table of LineItems? If not, you should. If yes, you can import the selected products into the LineItems table, then populate the OrderID field in the imported set with the OrderID of the new order.
nareyramos Posted October 15, 2013 Author Posted October 15, 2013 Understood but that is precisely my problem: I don't know how to import the selected products.
comment Posted October 15, 2013 Posted October 15, 2013 After establishing the found set in Products, switch to the LineItems layout and import records from the Products table (in the same file). When a file is open, Filemaker will only import the found set from it, so that's all you need to do. Of course, this can (and should) be scripted. You might also want to take a look at the demo posted here: http://fmforums.com/forum/topic/61693-go-to-portalrow-script-problem/#entry291726 Think of Attributes as Products and Objects as Orders.
nareyramos Posted October 23, 2013 Author Posted October 23, 2013 Thank you all. Now it works fine. Thanks again. NR
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now