locked
Adding a new External Database Views as Entities to an existing Screen does not retreive data RRS feed

  • Question

  • Hi folks;

    I have a question related to adding Entities (External Database Views) to an existing Screen. 

    I design a View Details Screen against two related Entities and use Tabs to organize the data.  I then include another Database View from an External Database and create the required Relationships.

    I open my existing View Details Screen and use the Add Entityname option.  Running the application does not retrieve data for the new Entity.

    If I start from scratch using the View Details Screen wizard, the screen will allow the selection of all related Entities and display the data correctly.  Since I am developing incrementally, I cannot keep starting from square one each time I need to add new Entities to existing screens.

    Any help would be appreciated.

    Tuesday, September 23, 2014 4:36 PM

Answers

  • I think I fixed my own problem...

    I noticed when I added a new Entity to the existing screen, the layout appeared to be for a single row.  (I knew the database design will be retrieving many rows).  When created from the wizard, the layout was automatically set to a Tile List.  This displayed multiple rows which was the desired result.

    I went back to my original screen and made its layout similar to what the wizard had created.  My Steps Tab should display multiple rows.  I added a Tile List and then defined the columns to be displayed in each Tile.

    I hope this helps anyone else that is new to Lightswitch that runs into the same problem.

    Thanks,

    Nigel

    • Marked as answer by NigelJames Monday, October 6, 2014 7:40 PM
    Monday, October 6, 2014 3:57 PM

All replies

  • Nigel:

    I don't really have an answer for you, but I have a couple of ideas.  I have done this many times and it works for me.  However, I have not added relationships from my views, so that is where I would look for the problem.

    I usually just add a LightSwitch query to each attached view with parameters like ClientId, StartDate and EndDate.

    I then add the query to the screen and bind the parameters.

    Mark

    Tuesday, September 23, 2014 5:54 PM
  • Mark;

    Thanks for the reply.  The existing Screen recognizes the new related Entity and provides the blue ".Add Xxxxxxxs" option.  I can then drag the desired column names onto the new Screen Tab.  I just get no retrieved data for this new Entity.

    If my Database Views and Relationship setup were incorrect, I would not expect the View Details Screen wizard to work... but it does. I cannot see any difference between a Screen created by the wizard and the existing Screen with a new database View Entity.

    Thanks, Nigel

    Tuesday, September 23, 2014 7:11 PM
  • I think I fixed my own problem...

    I noticed when I added a new Entity to the existing screen, the layout appeared to be for a single row.  (I knew the database design will be retrieving many rows).  When created from the wizard, the layout was automatically set to a Tile List.  This displayed multiple rows which was the desired result.

    I went back to my original screen and made its layout similar to what the wizard had created.  My Steps Tab should display multiple rows.  I added a Tile List and then defined the columns to be displayed in each Tile.

    I hope this helps anyone else that is new to Lightswitch that runs into the same problem.

    Thanks,

    Nigel

    • Marked as answer by NigelJames Monday, October 6, 2014 7:40 PM
    Monday, October 6, 2014 3:57 PM