AutoUpdate and Audit Trail

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

AutoUpdate and Audit Trail

Post by digitalphotoworld »

I have a table with activated audit-trail for edit records. Two of the fields are autoupdate-fields (logging user and date).
If a user clicks on edit record and leaves the page immediatly by clicking the submit button without changing any field, a change in audit trail is written about this action.

How could I prevent this behavior?


mobhar
User
Posts: 11768

Post by mobhar »

You need to customize PHPMaker template file, see the code in "WriteAuditTrailOnEdit" function from the "audittrail.php" file. You may compare between the old and new value. If they are the same then do not call "ew_WriteAuditTrail" function, otherwise just call it as usual.


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Can I disable writing to audittrail on the fly e. g. in Server Event row_inserting?


mobhar
User
Posts: 11768

Post by mobhar »

Yes, you can. To disable the audittrail in "Row_Inserting" server event, you may simply use:

$this->AuditTrailOnAdd = FALSE;


Post Reply