Can reference set selectors be filtered?

1
Context: Suppose I have entities CARS and CAR SALES where CARS * --> (1) CAR SALES (many CARS to one CAR SALES). CARS has two attributes, Color and Make. Suppose that every time a car is sold a CARS object is associated with a parent CAR SALES object. Question: Suppose there is a red car salesman; how can I allow the salesman to see only red cars in the reference set selector? He does not want to see yellow, blue, green, etc. cars that have been sold by other salesmen. In other words, can you filter the items displayed in a reference set selector? I am looking for a way to do this by manipulating the data source or other properties of the reference set selector, and not through a security protocol.
asked
2 answers
0

Matt,

In short, yes! Take a look at the "Selectable Objects" tab of the reference set selector. That's where you'll input some XPath to constrain the selection.

Now, since you want to limit a salesman to particular colors, you'll want to make sure you have an association Salesman and a Color. Car sales should be changed to have an association with the Color entity as well, and you should remove the "Color" attribute on CarSales.

In your Selectable Objects XPath, you'd want to write something like this:

[Module.Cars_Color/Module.Color/Module.Color_Salesman = '[%CurrentUser%]']

This XPath would limit the selection of cars to only ones with a color that is also associated to the current user's account. Hope that helps!

answered
0

If at all possible, use constrained by on selectable objects tab. This is also applied and refreshed when other elements change and can be used to make reference selectors depend on each other like the make and model of a car.

answered