Search code examples
c#javascriptvisual-studio-2013lightswitch-2013

Populate data according to choice in lightswitch html client


I have 3 tables tb_Accounts, tb_Jobs and DailyExpense

tb_Accounts can have many tb_Jobs, & DailyExpense can have jobs according to accounts.

When I select account(Contracter) on DailyExpense screen, only those jobs should popup who have the selected account name(Contracter). Right now all jobs pops up. See image: All Jobs appearing

I am using lightswitch 2013 Html Client on visual studio 2013 with C# and JS Thanks


Solution

  • You need to adapt the 'Jobs'-Query on your 'Daily Expense' screen by providing a corresponding filter, i.e. in the screen designer, click on edit query, add a where clause using a new parameter like 'Contracter' and bind this 'Contracter' parameter to the corresponding property of your screen object.

    While written for the SL client and not the HTML client (conceptionally the same!), this article of Beth Massi describes the required steps in detail.