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.
Here Test Version is the field name. The first value you see, Test2 [10010]
, is the old value and the second value, Test1 [10000]
, 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 preceding screen, the change log value for both old value and new value are displayed in the following format:
change log string [change log id]
Both the string value and ID value are 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 change log is written.
There are two methods, one for change log string
and another for change log id
, which...