create start and end date search query parameters on a list and details screen where the date field is on 3 relationship tables
Saturday, April 21, 2012 12:23 AM
Hello, I am hoping someone can guide into creating two search parameters what will allow me to query data from 3 tables (many) to 1,0 Table. I hope I dont need to create a WCF_service to accomplis this. I created a list and details screen from this Main Clients table. As you can see the Clients can have 1 or zero to many relationship to my other 3 tables.
Here is what the list and details screen looks like.
Where i have the redbox, this is where I want to add a Date picker that is Start Date and End Date to search on all 3 relationship tables on the right. What is the best way to accomplish and if I can get a sample to get started. Thanks for your help.
Saturday, April 21, 2012 12:55 AMModerator
Here's a general overview of how to do this:
- Create three queries (one over Articles, one over Blogs, and one over PressReleases) that each take three parameters (a client id, a start date, and an end date). Each query can be done completely in the designer. Each one will have two clauses ANDed to together: one where the Client.Id property is equal to the client id parameter, the other where the creation data is between the two date parameters.
- In the Client Details screen, set the source of the Articles, Blogs, and PressReleases collections to be these queries. Then bind the client id query parameter to the id of the selected item of the clients collection.
- Finally, create two local screen properties of type Date, one called StartDate, the other called EndDate. Make sure these properties are marked as NOT required, otherwise you won't be able to save screen data changes without providing values for these properties. Bind the corresponding query parameters of each collection to these properties. Then drag the properties out to the screen where you want them (right above the check boxes).
Justin Anderson, LightSwitch Development Team
Monday, April 23, 2012 1:33 AM
Thanks Justin, this worked great.
- Edited by Dbdmora Monday, April 23, 2012 2:30 AM