Jump to content

Price based on JoinTable issue


Devin

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

Recommended Posts

 

I've got 4 tables.  Product, Vendor, VendorProducts and Product Price.

A Product can have multiple Vendors. Each Vendor has their own price for a product.  My issue is I want to also Track the Price changes a vendor makes but also show the latest pricing when looking at a product. 

When setting up the Portal to list the VendorProducts on Products is not an issue but returning the latest Product Price based on a timestamp is the issue. I could create a script to place the latest price in the VendorProduct but that seems like the wrong approach.. The other thought is maybe create a Calc Field in VendorProducts to return the price is thats possible? Or maybe there is even a better way....   Thanks

2127809085_ScreenShot2019-11-15at2_02_21PM.png.d0de22b6cd52a5f1633b8b3640efed1e.png

 

 

Link to comment
Share on other sites

If you define the relationship between VendorProducts and ProductPrice to sort the records on the ProductPrice side in reverse chronological order, then the Price field placed in a portal to VendorProducts will show the most recent price.

Alternatively, you could define a calculation field in VendorProducts as:

Last ( ProductPrice::Price )

This is assuming that either the relationship is not sorted and prices are entered in chronological order, or the relationship is sorted in chronological order.

Link to comment
Share on other sites

This topic is 1620 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.