Jump to content
Server Maintenance This Week. ×

problem with value list based on complex relationship with indexing


aeu

This topic is 5464 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This topic is 5464 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.