locked
Query based on multiple tables RRS feed

  • Question

  • I have created a simple Lightswitch HTML application with two tables, Members and Payments. The Member table has the details of the member (firstname, lastname, address, etc) and the Payments table has a list of payments (date paid, amount, invoiceNo). The Payments have a Many-to-One relationship to the Member on the MemberID. The Member table also has a Boolean for LifeMember.

    I want to create a query that displays members that are either a LifeMember or have a payment within the last financial year. (ie 1 July 2015 - 30 June 2016)

    Wednesday, June 15, 2016 8:20 AM

Answers

  • Hi Lindsay R,

    According to your description, I create a sample project with your table relationship and when I try to add query for the Member table, I found that I could not add Payment filed as filter condition in the query edit screen.

    So please try create a Javascript query on HTML client side with filters. Please refer to following thread which introduce how to implement javascript filters on HTML client. Hope that can help you.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/752ed7ec-c4cd-43bd-ac3b-dc56c6fdaa13/html-client-javascript-apply-filter-to-screen-data-collection?forum=lightswitch

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 17, 2016 7:03 AM
    Moderator
  • Usually you would code the extra filtering in the query's '_PreprocessQuery' event.

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Friday, June 17, 2016 11:16 AM

All replies

  • Hi Lindsay R,

    According to your description, I create a sample project with your table relationship and when I try to add query for the Member table, I found that I could not add Payment filed as filter condition in the query edit screen.

    So please try create a Javascript query on HTML client side with filters. Please refer to following thread which introduce how to implement javascript filters on HTML client. Hope that can help you.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/752ed7ec-c4cd-43bd-ac3b-dc56c6fdaa13/html-client-javascript-apply-filter-to-screen-data-collection?forum=lightswitch

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 17, 2016 7:03 AM
    Moderator
  • Thanks Weiwei, I'll have a look at the link you posted.
    Friday, June 17, 2016 7:25 AM
  • Usually you would code the extra filtering in the query's '_PreprocessQuery' event.

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Friday, June 17, 2016 11:16 AM