Constellation 24.1 - Recalculate sequence number in embedded data table after add/delete row

I am using Pega Constellation 25.1 and have an embedded data table Payment Schedule (list of records) within a case type.

Each Payment Schedule record contains:

  • Name (Contractor Name)
  • PaymentSchedule (read-only numeric field)
  • Other payment-related fields

Requirement:

The PaymentSchedule field must be sequential per contractor.

Example:

1 Contractor A | PaymentSchedule 1

2 Contractor A | PaymentSchedule 2

3 Contractor A | PaymentSchedule 3

4 Contractor B | PaymentSchedule 1

5 Contractor B | PaymentSchedule 2

If a row is deleted, the remaining rows for that contractor must be re-sequenced.

Example:

1

Before delete"

1 Contractor A | 1

2 Contractor A | 2

3 Contractor A | 3

4 Contractor A | 4

5 Contractor A | 5

Delete row with PaymentSchedule = 3

After delete:

1 Contractor A | 1

2 Contractor A | 2

3 Contractor A | 3

4 Contractor A | 4

Challenge:

In Constellation, I am using the standard embedded data table with Modal add/edit records. I do not see an OOTB way to:

  • Run a Data Transform after Add Row
  • Run a Data Transform after Delete Row
  • Run post-processing when a modal record is saved
  • Trigger recalculation when the built-in table actions are used

Questions:

  1. Is there an OOTB way in Constellation to execute a Data Transform after adding or deleting a row from an embedded data table?
  2. Is there a recommended approach to dynamically generate row sequence numbers within a pagelist based on another field value (Contractor Name)?
  3. Would this require a custom DX component/action, or is there a Constellation-supported pattern for this use case?

Any examples or recommended design patterns would be appreciated.

in the Post Processing use the Function: @RemoveDeletedObjects to cleanup the embeded data objects.

hi @VinayY88 Since we are on Pega Constellation, the DX API triggers a refresh event every time a row operation occurs inside the embedded data table. By implementing our re-sequencing logic directly within pyRefreshData, the system will automatically recalculate and update the sequential number property across the entire page list immediately after a row is added or deleted.

I implemented this logic in the final Submit/Post Action Data Transform rather than putting it in pyRefreshData. If this were handled in pyRefreshData within the embedded class, I would also need to maintain similar logic for edit and delete scenarios to keep the contractor count and Payment Schedule sequence consistent whenever the embedded data changes. That would introduce repeated processing and additional logic across different operations. To avoid that complexity and unnecessary recalculation, I centralized the logic in the Post Action Data Transform, where the Payment Schedule is evaluated by contractor and the sequence/count is finalized only when the user submits the data.