Building the "Order Management" Training App : Adding a Calculated field
Prerequisite : The Supplier, Product, Client and Order objects are linked together
What is a Calculated field ?
A Calculated field, is a Field for which it's value is automatically calculated by the platform...Learn more
Adding a "Total" Calculated field to the Order Business object
The "Total" Calculated field will display the Order's total : Product price x Order quantity
Add the Product price Field to the Order Business Object
Start by adding the Product price field in the previously created "Product" Field Area :
- In the Business objects > Business objects menu, open TrnOrder
- Click Edit form on the Business object's form
- Just like for adding a new Field, hover over the "Product" Field Area, and click the
+
button - Click Field
- Open the Product panel, select Price and click Insert
This view also allows to add multiple fields from other linked objects
Add the Total Field
- Add a integer field to the TrnOrder Business object in the previously created "Order" Field Area
For a detailed guide on how to add a field, see Getting started : Create field
- Fill in the Field information like so :
- Label : Total
- Logical name : trnOrdTotal
- Physical name : trn_ord_total
- Updatable : Read only
- Click on the field's label
This opens the Field's definition
- On the Field's form, click More
- In the Expression tab fill in Calculated expression so :
[VALUE:trnPrdPrice]*[VALUE:trnOrdQuantity]
- Click Save
Test the Calculated field with the usertest User
To test the Calculated field, follow the steps below :
- Clear the platform's cache and log in using usertest
For a detailed step-by-step, see : Testing the User
- Open or create an order
- Change the value in the Quantity field
- Click Save
Success
Expected result :
The "Total" field is automatically updated
