Actions After Add, Edit, Save
Modifying Values before Saving Data

Code Customization
Modifying Values before Saving Data
Description:

You can easily modify data before saving it in the database, such as when encrypting passwords and adding audit trail data to a record. The best way to modify data is before saving the data to the database. When the user clicks on a button to save the data on the page, the data must first be extracted from the user interface controls and copied into a database record, so it can be saved into the database. You should modify the data after extracting it from the user interface and before it is inserted (updated) into the database.

The best way to modify a field value is to override the GetUIData() method at the record level, typically for an Add Record or Edit Record page. In the overridden GetUIData() method:

  • Call base.GetUIData() to get the data from the user interface control and populate a record object.

  • Get the populated record by calling this.GetRecord().

  • Set the new value in the record using myRec.MYFIELD = "NEWVALUE".

This customization will be added in:

..\<Application Name>\App_Code\<Table Name>\Add<Table Name>.Controls.cs

For example: C:\MyApp1\App_Code\Customers\AddCustomers.Controls.cs

Procedure:

Step 1:  Use this wizard to add code customization.

Step 2:  Build and run the application.

Applies To:

This code customization is applicable only for Add Record or Edit Record page

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.


  Privacy Statement