this.DataWorkspace.UserData.users = is a WCF Ria table that exposes the list of registered users
this.DataWorkspace.SHowroomData.Employees has a field where we have inserted the username from the above Ria table (http://traf-o-data.blogspot.com/2011/08/linking-lightswitch-data-to-logged-in.html)
I’m try to filter the customer records that are returned based on the store that the current user(employee) belongs to.
Here is the query and the error.

Thanks for any suggestions.
I don’t think, in PreprocessQuery() you can make a direct call on the datasource. You have to design your query without any “intermediate” results. Everything you need in that query has to be passed to the method as a parameter.
So either, 1) you pass the employee-data of the current user to the method or his ID using a screen property that contains this information and is linked to the query-parameter
or 2) try to include the currentuser – employee selection into the “query = ” line somehow, which should work, because stores and employees should have relation. You can address both, parent and child tables of any entity in LINQ to Entities.