How to create a table column that will auto-increment when there is any modification to the table records?
Custom table has been extended with a column "CCC_Version". How to customize the column to auto-increment in value whenever there is a modification to the records?
Modify the table script for the custom table in Designer | One Identity Manager Schema.
Select the custom table and click the "Table scripts" tab.
Add the following codes to the Script (OnSaving) field:
If Not $[IsLoaded]:Bool$ Then
Else If $[IsChanged]:Bool$ Then
Entity.PutValue("CCC_Version", $CCC_Version[o]:Int$ + 1)
Save the changes and compile the database.
Depending on the requirements, "IsDifferent" could be used instead of "IsChanged".
When changing a property from "A" to "B" and then back to "A" there is no changes involved in the end.
"IsChanged" would be true in this case but "IsDifferent" would be false - this is only true if at least one property is different than before.