You would appear to have these relationships:
Unit::__pkUnitID = Listing::_fkUnitID
Unit::__pkUnitID = Property::_fkUnitID
Is this correct?
If so, a portal to Unit can be set up with a filter expression that filters for values in Unit, Listing and Property.
Here's a screenshot of the TO's for that layout so far (Layout is working from the TO at the bottom Left, the Portal is for the TO named "Listings that Match Lead Criteria")
You can see I'm evaluating against beds criteria and baths criteria now, so as a person changes their criteria the listings on the portal view change. I'd like to also be able to evaluate against "Lisiting :: listPrice" vs "Lead :: priceMax" and probably even "Lead :: schoolDistrict" vs "Property :: schoolDistrict".
Is a filter on the portal the only way to do this? If so do you have any idea what this would need to look like in order to make the filter dynamic to the leads criteria entries?
1 of 1 people found this helpful
A filtered portal is not the only option, but it's the easiest to implement. It may be slow to update however, you'll have to try it and see.
First, two changes to your data model:
Make the relationship between Unit criteria for Eva... and Listings that Match.... a sorted relationship that sorts by listing date in ascending order so that the first related listings record is the most recent. Then add a TO of Property to your graph linked to Unit Criteria for Eva... by PropertyID.
Then your portal filter might look like this
Lead Criteria::Max Price <= Listings that match lead criteria::List Price AND
Lead Criteria::School District = New PropertyTO::SchoolDistrict
A more complex calculation that allows for empty Max Price or School District criteria may be needed.
Another method that might be used is to use ExecuteSQL to query on all of these criteria, returning the ID's of all matching units as a matching list--which then can be the match field to a TO of Units to list the actual unit records.
Correction. that sorted relationship should sort by date in Descending order...