![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got my relationships figured out, and I've got some tables set up, but I can't figure out how to make things work together. Filemaker Pro 7.0 Here are my tables: Items Projects ItemsProjects (Join Table) Any item can occur in one or more projects. Each project has at least several items. At any given time, there will be one or more ActiveProjects, but only one CurrentProject (the one the user is working on). I would like the user to be able to add an item to a project. I've got fields like ProjectsSN and ItemsSN as unique serial numbers in those Tables. I made ItemsProjects with both those as foreign key fields. I made a global field (g_currentProject) to hold the current project's ProjectSN. Should I script a button to make an ItemsProjects record with both the ItemSN and the ProjectSN? That seems easy enough. But how can I prevent the user from adding the Item more than once? My items are unique, so they can only be used once for any given project, but they might be used on a different project in the future. |

|
Also, I'm trying to populate a value list with active projects that I can use to fill in the g_currentProject field. I made a new table occurance of Projects, called ActiveProjects. Projects has a checkbox field (ActiveProject) with only one value "Active." I put a constant global field on the Items table called g_k_active. I put "Active" into that field. I tried to make a join between ActiveProjects and Items where ActiveProject = g_k_active, but when I make a portal of that table, it's filled with all the items, not just the ones with the checkbox checked. |
|
Thanks for any tips. Bob |
#3
| |||
| |||
|
|
In article <h4u9f.25666$NJ.9638 (AT) bignews7 (DOT) bellsouth.net>, not (AT) not (DOT) not says... Should I script a button to make an ItemsProjects record with both the ItemSN and the ProjectSN? That seems easy enough. But how can I prevent the user from adding the Item more than once? My items are unique, so they can only be used once for any given project, but they might be used on a different project in the future. Simply don't let users create an itemprojects record that already exists... have your script check for it first. ![]() |
|
Also, I'm trying to populate a value list with active projects that I can use to fill in the g_currentProject field. I made a new table occurance of Projects, called ActiveProjects. Projects has a checkbox field (ActiveProject) with only one value "Active." I put a constant global field on the Items table called g_k_active. I put "Active" into that field. I tried to make a join between ActiveProjects and Items where ActiveProject = g_k_active, but when I make a portal of that table, it's filled with all the items, not just the ones with the checkbox checked. It sounds like you've got the right general idea here. Context becomes important though. What table is the layout the portal is on set to? What is the path through the relationship graph to the ActiveProjects? (Also, make sure the fields inside the ActiveProjects portal point to ActiveProjects, not some other table occurrence.) |
#4
| |||
| |||
|
|
42 wrote: In article <h4u9f.25666$NJ.9638 (AT) bignews7 (DOT) bellsouth.net>, not (AT) not (DOT) not says... Should I script a button to make an ItemsProjects record with both the ItemSN and the ProjectSN? That seems easy enough. But how can I prevent the user from adding the Item more than once? My items are unique, so they can only be used once for any given project, but they might be used on a different project in the future. Simply don't let users create an itemprojects record that already exists... have your script check for it first. ![]() That makes sense! Is the best way to do that with a find command? Just find on ItemSN and ProjectSN and if I find a record like that pop up a dialog? That sounds easy. |
|
Also, I'm trying to populate a value list with active projects that I can use to fill in the g_currentProject field. I made a new table occurance of Projects, called ActiveProjects. Projects has a checkbox field (ActiveProject) with only one value "Active." I put a constant global field on the Items table called g_k_active. I put "Active" into that field. I tried to make a join between ActiveProjects and Items where ActiveProject = g_k_active, but when I make a portal of that table, it's filled with all the items, not just the ones with the checkbox checked. It sounds like you've got the right general idea here. Context becomes important though. What table is the layout the portal is on set to? What is the path through the relationship graph to the ActiveProjects? (Also, make sure the fields inside the ActiveProjects portal point to ActiveProjects, not some other table occurrence.) I wasn't having luck with the portal, so I tried to step back and just get the value list to work. If the value list came up empty it would make more sense than showing everything -- I think I must have made some really basic mistake that I'm overlooking. I made a layout of Projects, and every other record has the Active checkbox checked. But when I switch to the ActiveProjectsLayout (showing records from ActiveProjects), all my Project records are shown, not just the ones that have Active checked. |
But its not that complicated once you "get" it.|
On my relationship graph, ActiveProjects is related to Items with Active = g_k_active, and I typed Active into that field. If I then make a portal on my Items layout, showing records from ActiveProjects, it comes up empty (that's on the same layout where the value list has all the projects...) Bob |
#5
| |||
| |||
|
|
I've got my relationships figured out, and I've got some tables set up, but I can't figure out how to make things work together. Filemaker Pro 7.0 Here are my tables: Items Projects ItemsProjects (Join Table) Any item can occur in one or more projects. Each project has at least several items. At any given time, there will be one or more ActiveProjects, but only one CurrentProject (the one the user is working on). I would like the user to be able to add an item to a project. I've got fields like ProjectsSN and ItemsSN as unique serial numbers in those Tables. I made ItemsProjects with both those as foreign key fields. I made a global field (g_currentProject) to hold the current project's ProjectSN. Should I script a button to make an ItemsProjects record with both the ItemSN and the ProjectSN? That seems easy enough. But how can I prevent the user from adding the Item more than once? My items are unique, so they can only be used once for any given project, but they might be used on a different project in the future. Also, I'm trying to populate a value list with active projects that I can use to fill in the g_currentProject field. I made a new table occurance of Projects, called ActiveProjects. Projects has a checkbox field (ActiveProject) with only one value "Active." I put a constant global field on the Items table called g_k_active. I put "Active" into that field. I tried to make a join between ActiveProjects and Items where ActiveProject = g_k_active, but when I make a portal of that table, it's filled with all the items, not just the ones with the checkbox checked. Thanks for any tips. Bob |
#6
| |||
| |||
|
|
Hope this helps get you pointed the right way. Its hard to explain without pictures But its not that complicated once you "get" it. |

#7
| |||
| |||
|
|
Your setup as i understand it: Project :: ItemsProject :: Items With ItemsProject related to Project by ProjectSN and ItemsProject related to Items by Item SN. Allow creation of ItemsProject by way of the relationship to Project. |
![]() |
| Thread Tools | |
| Display Modes | |
| |