Skip to main content

Creating calculated fields

Archived

3 Tasks

15 mins

Visible to: All users
Beginner Pega Platform 8.5 Data Integration English
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded.

Scenario

The MyTown mayor and the services coordinator want to track the amount of time that crews spend on repair phases. New fields in the Perform Repair step must track setup, repair, cleanup, and total time for each repair. The Review Repair step must display the times as well.

The following table provides the credentials you need to complete the challenge.

Role User name Password
Application Developer author@mytown pega123!

Challenge Walkthrough

Detailed Tasks

1 Add fields to the Perform repair step

  1. In the App Studio navigation pane, click Case types > Service Request to display the Service Request case life cycle.
  2. In the Service request case type, on the Workflow tab, select the Perform repair step.
  3. In the contextual property pane to the right, click Configure view.
  4. Under the Field entry row, click + Add field.
    Perform repair
  5. In the Field name field, enter Setup time to name the field.
  6. From the Type drop-down, select Integer.
  7. Click Submit & add another.
  8. Repeat steps 5-7 to create integer fields named Repair time, Cleanup time, and Total time. 
    Field name Type
    Repair time Integer
    Cleanup time Integer
    Total time Integer
  9. Click Submit after adding Total time.
  10. From the Options drop-down, select Required for Setup time, Repair time, and Cleanup time.
  11. From the Options drop-down, select Calculated (read-only) for Total time.
  12. To the right of the Total time field row, click the Gear icon to open the Calculation configuration window. 
    Total time calculated
  13. From the Function drop-down, select Custom.
  14. In the empty field, enter .SetupTime + .RepairTime + .CleanupTime.
    Enter custom calculation
  15. In the entry box, click Submit to close the entry box and record the calculation.
  16. Click Submit to record the new fields and return to the Workflow tab of the case life cycle.
  17. Click Save to save your changes in the case life cycle.

2 Add read-only fields to the Review repair step

  1. In the Service Request case type, on the Workflow tab, select the Review repair step.
  2. In the contextual property pane to the right, click Configure view.
  3. In the left pane, click Fields to expand the Fields list. 
    Click Fields to open list
  4. In the list of fields, hover your pointer to the right of the Setup time field to display a Plus icon.
  5. Click the Plus icon to add the Setup time field to the view list. 
  6. Repeat steps 4-5 to add the Repair timeCleanup time, and the Total time fields.
  7. From the Options drop-down, select Read-only for the Setup timeRepair time, and the Cleanup time fields.
    Review repair with read-only text
    Note: The Total time field is already Read-only and does not require configuration.
  8. Click Submit to record the changes.
  9. Click Save to save your changes to the case life cycle.

3 Confirm your work (section not graded)

  1. In the Service Request case type, on the Workflow tab, click Save and run to create a new service request case.
  2. Complete any required fields and advance past the Request updates view.
  3. In the upper-left, click Actions > Change stage to display the change stage options. 
    Actions menu
  4. Verify the Next stage displays Resolution as the target stage.
  5. Click Submit to advance to the Perform repair step of the Resolution stage.
  6. In the Setup time field, enter 10 as the number of minutes spent setting up a repair.
  7. In the Repair time field, enter 80 as the number of minutes spent performing the repair.
  8. In the Cleanup time field, enter 30 as the number of minutes spent cleaning up the site after the repair.
  9. Tab or click out of the Cleanup time field to allow the calculation to execute and provide a total. In this case, the amount in the Total repair time field is 120.
    Verify your work with the calculated fields
  10. Click Submit to move to the Review repair approval step.
  11. Confirm the time entry fields display as read-only fields with the numbers you entered in steps 6-8. 
    Verify fields


Available in the following missions:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice