May 11, 200916 yr Not sure if this post should be here or under the Relationships forum, but here goes: I have a system that records the payments I make to vendors based on their work on projects. When I create a new payment, it has line items for multiple project line items that a vendor might have worked on. Here are some key tables and relationship fields (note: foreign keys begin with "F_"): Payment (F_vendorID) PaymentLine (F_projectID) Project (isActive.boolean) ProjectLine (F_vendorID) Vendor Here are some key ERD points: Payment has one Vendor Payment has many PaymentLine PaymentLine has one ProjectLine Project has many ProjectLine ProjectLine has one Vendor The Payment layout has a portal showing PaymentLine items. I want each PaymentLine record in the portal to have a Pop-Up Menu that lists ProjectLine records from active Projects (where isActive.boolean = 1) by Vendor (as selected for the Payment). I'm running into a snag because the relationship for the value list from PaymentLine to ProjectLine needs both vendorID and isActive.boolean (connected from a constant "1" field). However, F_vendorID resides in the projectLine table and isActive.boolean resides in the Project table. When I try to duct tape it by using a calculated field in projectLine to pull in the value of isActive.boolean, it won't let me index the field, and thus the value list and relationship from PaymentLine to ProjectLine do not work. Any help with this puzzle would be most appreciated!
May 11, 200916 yr Try defining a a calculation field cActiveID in ProjectLines as = Case ( Projects::IsActive ; ProjectLineID ) Then define two relationships: Vendors::VendorID = ProjectLines 2::VendorID ProjectLines 2::cActiveID = ProjectLines 3::ProjectLineID Now you can define your value list as showing only related values from ProjectLines 3, starting from Vendors.
May 12, 200916 yr Author Works like a champ - thanks! Note: the only change I made to what you suggested is that I started the value list related values from Payment rather than Vendors, since the field containing the vendorID in question is in the Payment table (i.e. the Vendor who is getting paid).
May 12, 200916 yr I believe it shouldn't matter, since it's the same vendor. Come to think of it, you could attach the added TO's directly to the Payments table instead of Vendors - since again, it's the same VendorID in both.
Create an account or sign in to comment