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:
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.
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:
Your desired screen type: You can keep this null, or change the value.
Name of an existing date column with settings that can be copied.
Name of columns that indicates start of the period.
Name of columns that indicates end of the period.
Column used for condional formating. E.g. (4) means value of column 4 has changed.
Domain of columns valid_from and valid_to. Use an already existing domain.
Domain of column conditional_layout_code. Use an already existing domain.
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.
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.