Customizing the change log value
One scenario we might come across when writing certain custom field types is to manipulate the way we display the change log. For a normal version picker custom field, the change log is displayed as follows:
In the preceding screenshot, Test Version is the field name. The first value you see, Test1 [[10000]], is the old value and the second value, Test2 [[10001]], is the new value.
Getting ready
Write your custom field type as described in the first recipe of this chapter.
How to do it…
As you have seen in the previous screenshot, the change log values for both old and new values are displayed in the following format:
change log string [change log id]
The string value and ID value are both stored in the ChangeItem
table. But before storing the value in the database, this value is generated from the individual custom fields. That is where we need to intercept, to manipulate the way the change log is written.
There are two methods—one for change log string
and another...