Hi again. OK I have a couple of questions, which I've searched and searched in the docs and this forum but yet can't seem to find an answer. Hopefully I can explain it in a way that makes sense.
So let's say, for simplicities sake, I have two Memento tables (Libraries) in my 'database' - one is an Orders table and the other is a Products table. These are structured as follows:
Orders
-----------
Country
(Single choice list)
Product Name
(Link-to-entry Products via 'Product Name")
Qty
Integer
Manufacturer Text
Product ID Num Text
Description
Text
etc. etc. etc.
Products
--------------
Country
Text
Product Name
as above in Orders
Inventory Amount
Ditto
Manufacturer
..
Product ID Num
..
Description
..
etc. etc. etc.
So the main table is the Orders table; that's the one the user opens and uses. Products is kinda like a lookup table. And I know this example isn't the best for referential integrity or only keeping one copy of data in a table, but it illustrates my point and questions. So first question:
1. The user opens the Orders table and create a new record. First thing on that new record is they have to selecting a country (via a drop down) - let's say they chose Canada. Once they do that, what I want to do is somehow get Memento to 'filter' the "Product Name" link-to-entry field so that when they click 'select' for the Product Name linked field next in Orders, it ONLY shows them Products that are available for Canada (or whatever country they choose).
I know I could easily write a script to do this, but how can I get it to filter the product name link for the chosen country IN REAL TIME as soon as they choose their country? Only way I can see to do this is via JavaScript just before or after they save the entire record itself... That's not what I want though. Isn't there a way to filter a link-to-entry field based upon another field as they are entering their data?
2. Let's say I figure out issue #1. Now they select, using the Product Name link-to-entry field, a single product from Products. Again, what I'd like to do is have Memento, after they select their product, to use the other fields in that chosen Product linked record (which will be previously filled in) and set/initialize the value in same named fields in the Orders table. I.E. Once they pick product Widget A, Memento would take the Manufacturer, Product ID Num, Description, etc. values from the chosen 'Widget A' Products record and set the same field-named value in now being entered Order record. Basically Products is like a lookup table, using it's data to 'pre-fill', so to speak, the Order table record being entered. Again, I know how to write a script to do this, but where, when and how do I place it? I can't see a way to do that in real time -- Only way I see is to have the user leave those fields blank and then run the script to fill them in just before or after the record is saved. Is there no way to do this type of thing when the user is actually entering the new data? Looking at the comments and documentation, and I'm probably being ignorant, but I just can't see a way to do this very basic type of database function in Memento!
Sorry for what probably is a 'dumb' question; but I've tried at length to figure it out on my own with no luck - so I figured "Why Not?" - I might as well go ahead and ask. I hope I'm just ignorant and there is an easy way to do this type of thing. Thanks in advance.
-T