Menu

Coded update (e.g. ModifiedBy)

0 votes

As many people do, we have tables that contain the following fields:

  • CreatedBy
  • CreatedOn
  • ModifiedBy
  • ModifiedOn

We can hide CreatedBy and CreatedOn and set them with default constraints at the database level. However, ModifiedBy and ModifiedOn is more difficult without using (resource-expensive) triggers. It would be better if there was a way to set these in dbfront.

in Customization by (280 points)

1 Answer

+1 vote
 
Best answer

You can have dbFront automatically populate the ModifiedBy and ModifiedOn fields by means of the Audit Value property on fields.

Please see the following links for further instructions.

by (65.2k points)
selected by
So how would you suggest setting this up? Leave the field selected in the table preferences and set the field preferences to read only and audit value to {datetime()}?
Yes, exactly as you stated.  I would still be tempted to use a database trigger for the modifiedOn since the trigger should be quite light and then you would capture the exact server time.
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
 |
Powered by Question2Answer
...