Get ID of Saved Record in Button Click event handler.
Description:
The database schemas usually issue record ID by calling the Newid() method or by using identity fields in your database.
You can retrieve the ID of a newly created record in the SaveButton_Click() button handler method after the CommitTransaction() method excutes
and use that record ID in your code customization.
The example retrieves the primary key of a record after saving it. It saves in a temporary variable so that you can use
this primary key in your own code customization. For example, you can redirect to another page and pass the saved record's ID field as URL parameter.
For a Web Application the customization will be added in:
For example: C:\MyApp1\App_Code\Orders\AddOrders.cs
Procedure:
Step 1: Use this wizard to add the code customization.
Step 2: Remove the initial call to SaveButton_Click_Base(sender, args) at the top of the code customization sample.
Step 3: Build and run the application.
Note:
This customization will get added in the Page class.
Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate
a feature, and may work only in specific situations. The Iron Speed Designer
support team cannot assist in the resolution of problems which may occur as a
result of customizing your application or modifying a customization to fit a
particular purpose.