This is a quick blog to show two techniques for adding calculated fields to an Oracle Visual Builder application.
Both techniques do the calculation on the client side (in the browser). Keep in mind that you might want to consider doing the calculation on the back-end of your application and get the calculated value delivered directly to your client - in some cases this results in better performance. But sometimes you don't have access to modify the backend, or you can't do calculations there, so here we go:
1. For simple calculation you can just use the value property of a field to do the calculation for you.
For example if you need to know the yearly salary you can take the value in a field and just add *12 to it.
You can also use this to calculate values from multiple fields for example [[$current.data.firstName + " " +$current.data.lastName]] - will get you a field with the full name.
As you'll see in the demo, if you switch to the code view of your application the code editor in Oracle VB will give you code insight into the functions you have for your page, helping you eliminate coding errors.