Table of Contents

Article

How to provide immediate display of computed values on a work object form

Summary

When you enable on-screen calculation, your application automatically recalculates the target value of a declarative expression whenever the user moves focus from one field to another on a work object form.

Your work object forms can display updated (read-only) totals, counts, or other computed values without requiring the user to submit the form and wait for a server response.

On-screen calculation is available for sections which appear in flow action and harness rules.

This article presents the development steps for V6.1. For V5.X, see How to provide immediate display of computed values on a work object form.

Note: In V6.2+, if the target values are computed for auto-generated controls such as pxTextInput, pxCurrency, or pxDateTime, the CalculatedValue parameter is not required. However, you must enable expression calculation in the harness or flow action as described in steps 1 and 2 below. The rest of the procedure below is unnecessary.

 

Suggested Approach

Before you enable on-screen calculation, create a Declare Expression rule and a property rule to hold the value of that expression. Then, complete the following steps to enable on-screen calculation:

  1. Open the harness or section rule that will display the calculated value.
  2. Click the icon to turn on the wireframe display.
  3. Select or add the field that will display the calculated value and click the () magnifying glass.
  4. At Cell Properties, add the property. In this case, .LineItemTotal.
  5. Or, select one of the standard HTML Property rules that has CalculatedValueas a parameter:
    • Text
    • CurrencyAmount
    • Date
    • DateTime
    • Decimal
    • Integer
    • Percentage
  6. Select the Read Only check box.
  7. If you are using any HTML Property rule other than CalculatedValue, click the () magnifying glass next to Display As. The Params window appears.
  8. Select the CalculatedValue check box and click OK.
  9. Save the updated Section form.
  10. Test.

At runtime, the system uses AJAX technology to communicate between the user workstation and the server. This communication is automatic and invisible to the user.

Tags:

Published May 18, 2010 — Updated June 17, 2010

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.