Skip to main content

Automating actions when a property value changes

2 Tasks

15 mins

Visible to: All users
Intermediate
Pega Platform '24.2
Enterprise Application Development
Dev/Designer Studio
English

Scenario

The Payroll Department at TGB reports that some employees enter an incorrect bank name when enrolling in direct deposit. The payroll department requests that the bank name populate based on the routing number entered to avoid errors in Payroll setup cases.

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

Role User name Password
Senior System Architect SSA@TGB pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Update the Bank information section

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter SSA@TGB.
    2. In the Password field, enter pega123!.
  2. In Dev Studio, search for and open the section rule ProvideBankInformation_0.
    Tip: You can use the search feature or the Records Explorer to locate the section rule. In the Records Explorer, use the filter option to locate the rule of interest.
  3. Double-click the embedded section to open the Cell Properties dialog box.
    provide-bank-information-section
  4. Open the BankInformation section rule.
    embedded-section
  5. Double-click the Bank name field to open the Cell Properties dialog box.
    Bank information section with the Bank name field highlighted
  6. On the Presentation tab, in the Edit options list, select Read-only (always).
  7. In the dialog box, click Submit to apply the changes.
  8. Double-click the Routing number field to open the Cell Properties dialog box.
  9. In the Cell Properties dialog box, on the Actions tab, for Actions type, select Standard.
  10. Click Create an action set to add an action set to the field.
  11. Click Add an event > Change to add a change event to the control.
  12. Click Add an action > Display: Refresh to add a Refresh-This section action to the field to display the updated bank name to the user immediately when they modify a routing number on the section.
    action-set
  13. Click Submit to apply the changes. The section resembles the following image:
    Bank information section
  14. Save the section rule.

2 Create the declare on change and activity rules

  1. In Dev Studio, open the Records Explorer.
  2. In the Records Explorer, click Decision > Declare OnChange to open the list of current OnChange instances in the application.
  3. Click Create to create a new Declare OnChange rule.
  4. On the new Declare OnChange rule, in the Label field, enter UpdateBankName.
  5. In the Apply to field, enter TGB-HRApps-Work-PayrollSetup to apply the Declare OnChange rule to the PayrollSetup case type.
    declare-on-change-record
  6. Click Create and open to create the Declare Onchange rule.
  7. In the Properties To Watch field, enter or select.RoutingNumber as the property to watch for changes.
  8. In the When field, enter or select Always to run the specified activity every time the routing number changes.
  9. In the When True Run section, enter the activity name UpdateBankName.
    declare-onchange-configuration
  10. Next to the activity UpdateBankName field, click the open icon to open the Create Activity form.
  11. Click Create and open to save the new activity rule as UpdateBankName.
  12. On the Security tab of the activity rule, in the Activity type list, select Onchange.
  13. On the Steps tab, configure the activity to apply the UpdateBankName data transform.
    Activity configuration
    Note: In this scenario, the UpdateBankName data transform uses the routing numbers specific to the United States to identify the financial institution with which the account is associated. To learn more about routing numbers in the United States, see List of routing numbers.
  14. Save the activity rule UpdateBankName and click the Declare OnChange rule tab.
    Note: The system displays a warning that the use of activity rules should be limited. The need for activities can be reduced by using data transforms, as well as techniques such as case management, the Engine API, and declaratives. To stay in line with best practices, limit the use of activities. 
  15. Save the Declare OnChange rule UpdateBankName.

Confirm your work

  1. In the User portal, create a new Payroll Setup case.
  2. Advance the case to the Provide bank information step.
  3. In the Routing number field, enter 021001088 and press the tab key to verify that the Bank name field automatically updates to HSBC Bank USA.
    Screenshot-showing-onchange-test-for-routing-number
  4. In the Routing number field, enter 124003116 and press the tab key to verify that the Bank name field automatically updates to Ally Bank.
    Screenshot-showing-onchange-test-for-routing-number
  5. In the Routing number field, enter 061000104 and press the tab key to verify that the Bank name field automatically updates to Sun Trust Bank.
    Screenshot-showing-onchange-test-for-routing-number
  6. In the Routing number field, enter 123107613 and press the tab key to verify that the Bank name field automatically updates to -- (blank).
    Screenshot-showing-onchange-test-for-routing-number

This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

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