Entity Reference and nested arguments in Views My site has 3 nodes:


Program, which is a list of Course nodes.
Course, which contains basic information about a course you can take
Course Date, a specific instance of a Course. Each Course Date references one Course, and the titles are auto-generated.


The view I'm scratching my head over is


I need a view that loads on each Program node, showing all current Course Dates who's Entity Reference matches any Course in the current Program.


It would be a lot simpler if each Course was only in one Program, but they aren't.

I've tried Relation and found it too buggy for production. I've tried Reference and Entity Reference, and settled on the latter as it seems more featured.

Would it be possible to automate some kind of reverse field reference? Any tips welcome!
Actually Entity Reference does implement reverse pointers, so to speak.

On your program view, which I suppose has entity reference fields to course nodes, first set up a Relationship (under the 'Advanced' view section) that will link to the view the specific Course nodes that exist for the current program as entity references.  


If you go to add a relationship, you'll get a dialog that looks like this:





Set it to filter the potential relationships to ones using 'Entity Reference' fields.
Select the 'Referenced entity' field that exists in the Program content type to point to its Courses (whatever you called it).  You can choose to change its name to 'Referenced course' or something short like that for later.  You can also limit the view to include only Programs that have course fields by checking that 'Require relationship' box!
Now all those course nodes are available in your view (you can add their fields to your view if you need to)
Next, add one more relationship.  This time look for the relationship that is a 'Referencing entity' (as opposed to 'Referenced entity') for your Course Date node.  That will provide a link to all Course Date nodes, which themselves reference the current Course node.  When setting up this second relationship, make sure you select the previous relationship to be used in the 'Relationship' dropdown.  After all, this reverse reference points to the course node of the current program, not to the current program itself, right?
Finally, you should now be able to add fields for course nodes and course date nodes that relate to your program, because of these two relationships.  Just make sure the fields you add, have the correct Relationship set from the relationship drop-down.  That way they will pull from the correct node.