This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Filter data by a field in a related entity
Last Post 01 Aug 2013 10:30 PM by nu_81. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
NunzioUser is Offline
New Member
New Member
Send Private Message
Posts:3
Avatar

--
25 Jul 2013 05:33 AM

    Hello,
    first of all I want to introduce myself.
    My name is Nunzio, living Germany and I'm going to realize my first Project in Lightswitch with a Silverlight client. Unfortunately I have a problem which I'm not able to solve it alone. 

    I have two entities on a given SQL Database (Addresses and Customer Data). These are linked as 1 Address to n Customer Data. So in theory it's possible to have more than one customer account for an address. But practical we don't use this. Now I have created a Silverlight Screen with editable grid for addresses and in the bottom there will be shown the customer data for the selected address. In the customer entity is an information about the assigned sales representative to the customer. I want to have the possibility to filter the addresses for this sales representative. So when I make a choice the address list should show by example only my own related addresses. 

    Can anyone please give me an advice how to realize that.

    Thank you in advance.

    By Nunzio

    NunzioUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:3
    Avatar

    --
    31 Jul 2013 06:40 PM
    Hello,

    could someone please tell me if my goal is principally possible.
    If not, I could stop searching a solution.

    Thank you much.
    Nunzio
    Karan GuptaUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:7
    Avatar

    --
    01 Aug 2013 08:42 PM
    Hi

    Let me understand your requirement clearly. You have a table called address and another table called customer. There is one to many relationship between address and customer i.e. 1 address can have many customers. Now you want to create a screen to filter address based on selected customer.

    Please correct me if I am wrong
    NunzioUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:3
    Avatar

    --
    01 Aug 2013 10:30 PM
    Hello,
    thank you for your answer.
    Yes you are right.
    In theory it is possible to create many customer accounts to one address.
    But we don't use is.
    I connected these two tables with 1:n and show the address information in a grid in the bottom and show the "sales representative" field of the customer entity on a detail screen below (no grid, because we have only one address to one customer account).

    But now I want to filter all addresses which are assigned to a specific sales representative.

    I hope it was described clearer now.

    Thank you!
    You are not authorized to post a reply.


    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation