Set Audit Fields on Insert

This customization shows how to implement an audit trail by creating and modifying audit fields in a database record.
Table Name
Select the name of the database table
Audit Field
Select an audit field in the table
Applies to
RecordClass class
/// This custom method is an event handler for the insert event in the Data Access layer.
private void Audit_Insert(object sender, System.ComponentModel.CancelEventArgs e)
	/// You can modify the following sample code to fit specific need
    // string s;
    // s = (this.${Audit Field} + "Inserted by: " + BaseClasses.Utils.SecurityControls.GetCurrentUserName() + " on " + DateTime.Now.ToString() + ".").Trim();	    

    // this.${Audit Field} = s;
    // Set values of other fields.
    // this.UserName= "loggedInUser";  
Applies to
CSharpRecordClassConstructor class
    // The following line will be inserted inside the
    // constructor for table record class.
    this.InsertingRecord += 
        new BaseClasses.IRecordWithTriggerEvents.InsertingRecordEventHandler(this.Audit_Insert); 

Terms of Service Privacy Statement