The following lesson in the Guided Tour shows how to create a Shell command that launces a screen: http://msdn.microsoft.com/en-us/library/ff852049.aspx
The example uses a parameter from a search sceen to display a details screen, but you could easily modify it to launc a New Data Screen.
Hope this helps,
Steve Hoag Microsoft aka the V-BeeMonday, March 21, 2011 3:09 AM
In the screen designer, create a Button, then add the following code,
Here Customers is the name of the table to which you want to add data.Monday, March 21, 2011 5:51 PM
This doesnt work AddAndEditNew() doesnt exist? Am i missing a reference?
OK im using Projects as my table that the first screen is accessing. I want my button to add a Note, Notes are in a seperate table and have a zero or one relationship with the projects tableTuesday, March 22, 2011 5:37 AM
Add the button in the screen designer. Then right click on the button and select the execute code method. In the execute code method type application.ShowNewNoteScreen or whatever the screen you want to show is called. It will be something like ShowNotesScreen.
Tuesday, March 22, 2011 6:50 AM
- Proposed as answer by Gberg Tuesday, March 22, 2011 6:50 AM
AddAndEditNew() did not exist because the table is not one of the data sources for the screen.
First, you need to add your Notes table to the Project screen through Add Data Item at the top of the screen deisgner.
Second, use this following code to add a new Note and bring up the modal dialog,
partial void Method_Execute()
// Create a new note and attach it to the current project
Note note = Notes.AddNew();
note.ProjectsItem = Projects.SelectedItem;
}Wednesday, March 23, 2011 6:54 PM