Creating calculated fields
Archived
3 Tasks
15 mins
Beginner
Pega Platform 8.4
English
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
- In the App Studio navigation pane, click Case types > Service Request to display the Service Request case life cycle.
- In the Service request case type, on the Workflow tab, select the Perform repair step.
- In the contextual property pane to the right, click .
- Under the the Field entry row, click + Add field.
- In the empty field, enter Setup time to name the field.
- From the Type drop-down, select Integer.
- From the Options drop-down, select Required.
- Repeat steps 3-6 to create required integer fields named Repair time and Cleanup time.
Field name Type Option Repair time Integer Required Cleanup time Integer Required - Repeat steps 3-5 to add an integer field named Total repair time.
- From the Options drop-down, select Calculated (read-only).
- To the right of the Total repair time field row, click the Gear icon to open the Calculation configuration window.
- From the Function drop-down, select Custom.
- In the empty field, enter .SetupTime + .RepairTime + .CleanupTime.
- In the entry box, click to close the entry box and record the calculation.
- Click Workflow tab of the case life cycle. to record the new fields and return to the
- Click to save your changes in the case life cycle.
2 Add read-only fields to the Review repair step
- In the Service Request case type, on the Workflow tab, select the Review repair step.
- In the contextual property pane to the right, click Configure view.
- In the left pane, click Fields to expand the Fields list.
- In the list of fields, hover your pointer to the right of the Setup time field to display a Plus icon.
- Click the Plus icon to add the Setup time field to the view list.
- From the Options drop-down, select Read-only.
- Repeat steps 4-6 to add the Repair time and Cleanup time fields.
- Repeat steps 4-5 to add the Total repair time field.
Note: The Total repair time field is already Read-only and does not require configuration.
- Click Submit to record the changes.
- Click Save to save your changes to the case life cycle.
3 Confirm your work (section not graded)
- In the Service Request case type, on the Workflow tab, click Save and run to create a new service request case.
- In the Create view, complete any required fields before advancing the case.
- In the upper right of the Report problem view, click to display the change stage options.
- From the new drop-down list, select Choose a stage to display the case stages.
- From the drop-down list on the right, select Resolution as the target stage.
- Click to advance to the Perform repair step of the Resolution stage.
- In the Setup time field, enter 10 as the number of minutes spent setting up a repair.
- In the Repair time field, enter 80 as the number of minutes spent performing the repair.
- In the Cleanup time field, enter 30 as the number of minutes spent cleaning up the site after the repair.
- 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.
- Click to move to the Review repair approval step.
- Confirm the time entry fields display as read-only fields with the numbers you entered in steps 6-8.