In my model-driven app, I have a polymorphic field, Resource that refers to 2 entity types-- Facility and LabourRate. On my form, I've set the Resource field to refer to a view from Facility and a view from LabourRate. Under some conditions, I need the Resource lookup to only show Facilities or only show LabourRates.
I think this should be possible by using javascript to temporarily change the lookup views that the Resource field refers to. But I'm not clear on the document model so I don't know how to best approach this.
Any hints or good info sources?