Enhanced Changelogs with DoSQL
Wednesday, April 29th, 2009For this week's blog article, we want to extend a special thanks to Kevin Frank and Dave Walton who sent us the example.
When using DoSQL to create a ChangeLog of your records, you want to avoid creating log records when nothing has actually changed.
The trick is to prevent DoSQL from firing unless you want to log a change... take a look at the example and check the validation on _K in the Data table... basically, if the parent sees that nothing has changed since the last corresponding ChangeLog record was created, then doSQL won't trigger.

Note that if you have no ChangeLog record for a given parent record, then it will be created *regardless* of which parent field you edit, but... once you have at least one change log record for a given parent, then any "don't log" fields will be respected.
The thing I like about this technique is that ChangeLog records will be created when a Replace is performed and when parent records are imported.
