There are some situations in which we need a place-holder sort of to show dynamic data like to show the calculated tax or to show time remaining between planned completion date and current date.
The best way to achieve this is to use non-persistent field.
Following are the steps:
1) Go to Database Configuration, search the table where we want to add the non-persistent field.
2) Go to Attribute tab and add a new field, make sure the “persistent” checkbox is unchecked.
3) Apply configuration changes
The field is created and if you see the table in your database it won’t exist as a column.
The next step is to calculate the tax and show on this field. Create a class which extends psdi.mbo.MboValueAdapter.
Override the “initValue” method. The thing to notice here is if it would have been a persistent field we would be overriding “init” method.
Do the calculations there and “getMboValue().setValue(“value”,NOACCESSCHECK)” and we are done 🙂
All these articles assume you have a good understanding of Java and are aware of database fundamentals.