This is an Archived topic. The solution is available in the Thinkstore inside the Software Factory.
Goal
When you have system versioned tables in your database, SQL Server logs all changes made to the data in those tables. This solution makes this logging data available for the user. This can look like this:

Solution
The solution in this topic creates views on all system-versioned tables. These views give the user access to the logging data. Also, all of these views get conditional layouts in the Software Factory. These conditional layouts give fields with changed values a color, which makes it easier to analyze the data.
Dynamic model meta_view_history
This code create a view definition for every system versioned table, along with conditional layouts to point out changed data.
When you add this code to the dynamic model, you have to change a few values first:
@screen_type_id
Your desired screen type: You can keep this null, or change the value.
@original_date_column
Name of an existing date column with settings that can be copied.
@valid_from
Name of columns that indicates start of the period.
@valid_to
Name of columns that indicates end of the period.
@conditional_layout_code
Column used for condional formating. E.g. (4) means value of column 4 has changed.
@date_dom_id
Domain of columns valid_from and valid_to. Use an already existing domain.
@conditional_layout_code_dom_id
Domain of column conditional_layout_code. Use an already existing domain.
Control procedure view_history
This control procedure adds the queries to all views on the system versioned tables. Also, the field conditional_layout_code is filled with the column numbers of the columns with altered values.
Template view_history
The template contains code for the view. COL_ID contains all columns of the table. COL_ID2 contains the columns to be compared for the conditional layout. PK contains the primary key columns in a row, separated by comma's.
In the attachment you will find the code of this solution.