October 8, 201213 yr Newbies I have two related databases. The first one is called "Invoices" and has two tables. The first table called "Invoices" has the following fields: "Record ID", "Invoice Number" and "Description". The second table called "Line Items" has the following fields: "Record ID", "Product ID", "Description", "Price", "Quantity" and "Invoice Total". The second database is called "Product" and has the following fields: "Product ID", "Description", "Price" and "New". This last field is a check box field that is check-marked when the product is new in the market. Now, as you can imagine, I have a portal in my "Invoices" database (and table) showing records from "Products" to which I add quantities and my summary field "Invoice Total" gives me the total amount for that invoice. I want to have a button in my "Invoices" that when clicked it automatically gives me all the products that are checked-marked as new in the market in my "Products" database, which would include their product ID's, descriptions and prices. My problem is that I don't know how to do that. Can somebody help? Thanks in advance.
October 8, 201213 yr Why can't you use your check box as your relationship. Meaning, create a global field in your invoice table and designate it as a number or a value that is equal to the check box. I set my check boxes to a value of 1 and I set my global field to 1 every time I navigate to my invoice table within my script. Build a relationship between the Invoice Global 1 and the Products 1 ck bx. Now that you have the relationship built, you can now either display your records in a portal or you can create a script that could automatically goto related records and do what you have to do I suppose. When you use the term "Gives Me" all the products that are checked marked, I'm assuming you are wanting to see all the products. With the relationship built, you now have the ability to create a portal with all your fields you desire. If you allow access to your Ch Bx within your portal you can de-selected your check box and that product will no long show up. What I often do is have two portal, sometime on different tables, one the shows all check boxes and one that shows all non-check boxes, that way I can push and pull product back and forth as i check the boxes within each portal. Tom :-)
October 8, 201213 yr Also, if you build this relationship, make sure you build a script trigger that will trigger and "Commit" the record. If you don't and you don't hit the enter key, the relationship won't build even though the ck bx is checked. Tom :-)
October 10, 201213 yr Author Newbies Tom, thank you very much for your input but I'm still stuck with my problem. And my problem is not creating the relationship but being able to display all the products classified as new in my portal with one single click on a button. I have tried to upload a sample database for a better understanding but for some reason FMForums doesn't let me. Anyhow, I would appreciate any new ideas. Thanks. Ney
Create an account or sign in to comment