Adding business logic
  

Try Rollbase Now

Adding business logic

After an application contains the appropriate objects and relationships to capture data, you will likely want to add logic that uses or transforms that data. Rollbase supports this through templates and formulas. Templates allow you to define a structure for calculating and displaying information. Templates contain tokens, which are variables that the runtime replaces with values from the object currently in scope. Formulas are interpreted as Javascript expressions, they describe how to calculate values. If a template contains formulas, the runtime first parses the merge tokens to obtain the values. Once the values are obtained, the runtime evaluates the Javascript expressions using the appropriate values.
For example, suppose an object contains fields for quantity and price and you want to calculate the price of a particular quantity. Using the tokens, {!quantity} and {!price}, which correspond to fields in the relevant object, the runtime will handle them in a formula as follows:
*Formula: {!quantity} * {!price}>
*Parsed formula values evaluated as Javascript: 100.0 * 5
*Result: 500
The following table describes the areas of a Rollbase application where you can use templates and formulas and why you might use them.
Templates
Where and How Used
Formulas
Where and How Used
Create in page editor
Object formula fields
Object definition
Create in Object definition
Trigger conditions and expressions
Part of trigger definition that determines when trigger will run or what value to use as a result
Object definition to automatically generate record names
Workflow action conditions
Part of workflow definition that determines whether workflow should proceed
Object and workflow definitions to dynamically generate e-mails
Field validation conditions
Object field definition
Workflows, template-based reports, and Document Template fields to dynamically generate documents
Values calculated in gauges
Part of gauge definition to calculate values to render in the gauge
Report definition to dynamically generate reports
In non-formula templates, such as email or document, use to embed a formula
* Working with templates
* Formulas
* Triggers and workflows
* Automating business decisions with Corticon rules
* Reports, charts, and gauges
* Multi-currency support
* Surveys and quizzes