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

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


Sorting by relation
Last Post 21 Aug 2013 06:07 PM by Xaser512. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
NextNext
You are not authorized to post a reply.
Author Messages
XaserUser is Offline
New Member
New Member
Send Private Message
Posts:7
Avatar

--
21 Aug 2013 06:07 PM
    Hello.

    I've read several posts here on sorting on related entities in HTML LightSwicht with an OData service connected to a SQL Server database, but I'm not sure, if my problem can be solved.

    If have a relation (One-To-Many):

    CraneType can be assigned to many Companies.
    So I have a table "CraneType" and a relation table "Crane2Company"
    Table CraneType
    - CraneTypeId
    - CraneType

    Table Crane2Company
    - Crane2CompanyId
    - CraneType
    - SortOrder

    No I want to select a CraneType in a dropdown which is filtered to the given Company in the current data item.
    This is working fine so far. But I want to display the CraneTypes in the dropdown sorted by the column "SortOrder", which is stored in the relation table. How can I do that?

    I'm really sure that it cannot be achieved directly in the "GetCraneTypes_PreProcessQuery().." but is there any possible workaround, like computed field or extra field in database!?

    Thanks for any reply.
    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