After displaying variables from workflow in module listbox, how to make them shown in the object document's view? Now we will learn to add a String Field in our Discussion Thread View to show the State of the workflow.
Go to the main page and click on Discussion Threads, then click on a Thread. That is the Discussion Thread view. Now click on the developer button as circled in blue in the slide.
On the up right side of the developer page, choose "StringField" and add it.
After you define the ID and Title of this string field, click on "Add and edit", uncheck "Editable" in Validator properties. This will make the state of thread object not editable, so that the users' interaction will not break the system's workflow which has been settled.
In order to access the state through "my_translated_'NAME_OF_MY_STATE'_title", define the ID of the string field "my_translated_validation_state_title". You can also verify if the getters are well generated by calling them directly: erp5/"id module"/"id thread"/getValidationState.
If you have problems with this rendering, e.g. nothing showing in State, here are some explanations of what can cause this: It can be your old discussion_thread_module, we made many changes on the portal_type and they did not affect items created before. The best thing to do is to delete all objects in the module. You can do it with the delete button, or use manage_main on the module, select all objects in the list field and use "delete" button at the bottom. Another behavior that can be encountered at this step can be caused by the cache system. You can clean the cache in portal_caches. The selection of your listbox (a list of what must be listed in it) can also be a problem for you. You can reset the listbox setting by using "Show All" button or by going in portal_selections. These two points are not really a problem, they are just an optimization of ERP5.