Set Audit Fields on Update

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 update event in the Data Access layer.
private void Audit_Update(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;
    // Update other fields
    // this.user= "loggedInUser";   
Applies to
CSharpRecordClassConstructor class
    // The following line will be inserted inside the
    // constructor for table record class.
    this.UpdatingRecord += 
        new BaseClasses.IRecordWithTriggerEvents.UpdatingRecordEventHandler(this.Audit_Update);

Terms of Service Privacy Statement