Reputation: 1560
I have a UserSettings entity. Each user will have one and only one row in the table. I'd like to give users a menu group called Settings containing a menu item called User Settings which opens a Details screen on their row, so that they can edit their own settings. I don't want them to see a list of UserSettings, even though I could filter it to just their row because it doesn't look good.
I've read that you can only add a screen to a menu if the screen doesn't have parameters. I can remove the UserSettingsId parameter from a new Details screen for UserSettings and it appears in the Include Screen drop-down on the Screen Navigation tab but I can't set the UserSettings object for the screen in code because it's read-only.
Is there any way for the user to go straight to a edit screen, without selecting the item to be edited from a list?
I'm using VS LightSwitch 2013.
Upvotes: 0
Views: 403
Reputation: 311
If you're using the in-built security model, you should be able to interrogate the User object (which is a child object of the Application object). This can be used to populate a screen variable for the user name based on a look up at run-time which you can then pass to a Query on your Settings table based on UserID or UserName as appropriate.
HTH
Upvotes: 0