To automate this simple calculation I configured 3 Business Rules. Firstly, the rule that sets Line Total = Unit Amount x Qty (when both those fields are populated):
And two additional Business Rules to clear the Line Total field once either of the input fields are cleared:
A few other things to know about Business Rules…
Once a field is referred to within a Business Rule that association becomes part of the field’s properties, visible from the form designer:
- When setting a field value you can only draw from fields of a similar data type. In the example above I was able to set a Currency field based on a Floating Point field and another Currency field. But if I want to set a Text field based on an Option Set or Lookup field I’m out of luck.
- When setting a field you can’t draw on any context information such as the current user or current date time. I tried to workaround this be setting fields based on Modified On and Modified By but those values are only as current as the last save so are do not reliably give you ‘now’.