Unanswered Set New Data Screen as Default Screen in LS 2012

  • Wednesday, January 30, 2013 7:27 PM
     
     

    I am using Lightswitch 2012. I built a master detail screen and an add new record screen. When I click the add new record in the mater details screen it generates it's own data entry screen instead of using the one I created. How do I get the add new record button on the mater details screen to show my screen instead of the automatically generated screen?

    Thank you

    jd

All Replies

  • Thursday, January 31, 2013 5:04 AM
    Moderator
     
      Has Code

    If you want to launch your new screen using the Add... button on a collection control (e.g. list or data grid), then setting the screen as the default for the entity type will not help. What you need to do is write code that will open the screen. You can right-click on the button in the screen designer and select Override Code. Then, write code to open the screen:

    partial void CustomerListAddAndEditNew_Execute()
    {
        this.Application.ShowCreateNewCustomer();
    }


    Justin Anderson, LightSwitch Development Team

  • Thursday, January 31, 2013 4:10 PM
     
     
    Yes this worked and my screen shows up. However, the Auto_Complete boxes, which were changed to Column Layout don't work. I can't even enter any data directly much less use the drop down the boxes are grayed-out. I changed the AutoComplete boxes to Column Layout so the user can choose from a description rather a number code. When I open my AddNew Screen directly the ColumnLayout boxes work as designed. Any ideas?