Extending communication types
The cases in Pega Government Platform capture data for several communication types, for example, email or phone. If you want to capture additional information, for example, social media ID, extend the default communication types.
In the Dev Studio Explorer panel, click .
On the Records tab, click the Add record link.
The entries in the Category column (Person or Business) refer to one of two cases: Add Person or Add Business.
In the Explorer panel, click App. In the search field, enter PegaPS-Data-Context-Application.
Click
.Update the Source column with the records from step 2. For example, in the source for the PersonCommType4 target, enter the record that you want to display first in the Person details form.
Modify the cases to which you want to add communication types by performing the following actions:
- To modify the Add Person case, in Dev Studio, search for and select the pySetFieldDefaults data transform rule in the PegaPS-Data-Entity-Person class.
- To modify the Add Business case, in Dev Studio, search for and select the pySetFieldDefaults data transform rule in the PegaPS-Data-Entity-Business class.
- To modify the Add Facility case, in Dev Studio, search for and select the pySetFieldDefaults data transform rule in the PegaPS-Data-Entity-Facility class.
- To modify the Add Vehicle case, in Dev Studio, search for and select the pySetFieldDefaults data transform rule in the PegaPS-Data-Entity-Vehicle class.
Add a step in the data transform rules for the additional communication type.
For more information, see Data Transforms.
To modify the Add Person case, in Dev Studio, search for and select the Comms section rule in the PegaPS-Data-Entity-Person class.
From the Layout drop-down list, drag the Embedded section option into the Comms section.
In the Section Include window perform the following actions:
From the Page context drop-down list select Use clipboard page.
In the Class field, enter PegaPS-Data-Comm.
In the Clipboard page field, enter .CommList(4).
From the first Section drop-down list select By name and from the second list select ContactString.
To modify the Add Business case, in Dev Studio, search for and select the Comms section rule in the PegaPS-Data-Entity-Business class and repeat steps 7 through 8.
To modify the Add Facility case, in Dev Studio, include the ContactString (PegaPS-Data-Comm) section with the PageContext .CommList(3) in the FacilityContactDetails (PegaPSData-Entity-Facility) section.
- Optional:
To add validation for the new communication type, create the required class, property, and data transform rules similar to the rules in the PegaPS-Data-Comm-Phone class. The validation checks might include forcing email address entries to contain the @ character or restricting the number of available characters in a field.
For more information, see Creating a rule.
Previous topic Extending multiple persons Next topic Adding a field to the existing vehicle owner details