![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? Thanks in advance, Bill |
#3
| |||
| |||
|
|
I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? |
#4
| |||
| |||
|
|
You would probably also need to have a button on each record to "Don't Add" it in case the user changes their mind about a particular record before pressing "OK". (Or if you want to be fancy, a button that alternates between "Add" and "Don't Add" with each mouse click.) |
#5
| |||
| |||
|
|
I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? Thanks in advance, Bill |
#6
| |||
| |||
|
|
I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? Thanks in advance, Bill |
#7
| |||
| |||
|
|
From what I've seen, I'll take a different approach then many of your other responses. Though tyhe site is down at the moment, you can go to http://www.briandunning.com/filemaker-custom-functions/> and search on 'value filter' for some custom functions that will do what you want. Go to http://www.databasepros.com/resources.html and enter "True Value Filter" (without the quotes) as your search criteria. The key is in using the ValueListItems or GetNthRecord() functions to get the values of B (or in your case, you'll want the record IDs for those values) and filtering out the 'B' IDs from the AB records athat are related from 'A'. The result would be a calc field that contains a list of B_IDs for all the B's not already in the related ABs. Use this in your portal relationship to show the B's that you want. You can do all of this without scripts. After taking a look at the examples on the above two websites, let us know if you need help applying those examples to your specific situation. Bill Cohagan wrote: I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? Thanks in advance, Bill |
#8
| |||
| |||
|
|
I'm using FMPro 8 Advanced. My database has got a many-to-many between tables A and B represented by a table AB -- so it's the normal A -<AB>-B sort of pattern. In my application I have a form layout for A in which I want to allow the user to add a new AB record; i.e., relate an additional B to the specific A. I want to do this by way of a pick list, a new window that opens and presents a portal containing B records that might be added. (Ultimately I'd like this to be a multiple select list, but that's another story.) The trick however is to populate the portal ONLY with B's that aren't already related to A via AB. I'm at a loss as to how to define the corresponding relationship between A (or AB) and another instance of B that will provide just those records out of B. One thing I've considered is using a global field containing a multi-key constructed from the elements of AB related to the specific A, but I need a != relation and (as I understand) using a != with a multi-key would use "or" semantics and not produce the list I'm looking for. Any suggestions? Thanks in advance, Bill |
![]() |
| Thread Tools | |
| Display Modes | |
| |