Skip to content
KiweelyKiweelyKiweely

Deleting Selected Grid Rows and Fixing Parallel Multi-Instance Arrays Collapsing on Edit Pages in Workday Extend PMD

Workday Extend PMD does not permit outbound DELETE calls inside onRowSelect, and storing grid columns as separate multi-instance fields on a single BO record causes edit grids to collapse into one row. Learn how to handle row deletion on submit and zip parallel arrays by index.

  • Checked against Workday on
  • Applies to Workday Extend
  • 3 min read
  • Published
  • By Kiweely
On this page

Why Outbound DELETE Endpoints Cannot Run Inside onRowSelect

In Workday Extend Presentation Metadata (PMD), grid selection events such as onRowSelect are designed for client-state and UI updates—such as filtering in-memory arrays, toggling widget visibility, or calculating subtotals—not for executing outbound write or DELETE transactions against Model Business Objects (MCBOs). Attempting to trigger an outboundData endpoint with "httpMethod": "DELETE" directly from onRowSelect fails because outbound write endpoints are only executed during page submission (onSubmit / outboundEndPoints) or when a deferred inbound endpoint is invoked from an action event.

Furthermore, deleting a database record the instant a user checks a selection box creates an irreversible side effect before the user clicks OK to confirm the page transaction.

Pattern 1: Deleting Selected Grid Rows via PUT or onSubmit

Depending on how your Extend Business Object is modeled, use one of two patterns to remove rows selected by the user.

Updating a Parent Business Object Collection with PUT

When the grid rows represent child business object instances linked to a multi-instance reference field on a parent Business Object, the cleanest transactional approach is to let the user select rows to remove (or use the built-in row removal minus - action when doNotRemove is false) and persist the remaining collection back to the parent Business Object using a PUT outbound endpoint on page submit.

json
{
  "type": "grid",
  "id": "detailsGrid",
  "label": "Roles and Organizations (Select Rows to Remove)",
  "selectionEnabled": true,
  "rows": "<% parentBoEndpoint.data[0].roleAssignments ?? [] %>",
  "rowVariableName": "row",
  "columns": [
    {
      "type": "column",
      "columnId": "childBOColumn",
      "label": "Assignment ID",
      "cellTemplate": {
        "type": "text",
        "id": "childBoId",
        "value": "<% row.id %>",
        "enabled": false
      }
    },
    {
      "type": "column",
      "columnId": "roleColumn",
      "label": "Role",
      "cellTemplate": {
        "type": "text",
        "id": "roleName",
        "value": "<% row.role.descriptor %>",
        "enabled": false
      }
    }
  ]
}

In the outbound PUT endpoint’s onSend event handler, filter out any rows that appear in detailsGrid.getSelectedRows() so only the retained child references (plus any newly added rows) are sent in the PUT payload:

javascript
"outboundData": {
  "outboundEndPoints": [
    {
      "name": "updateParentBo",
      "baseUrlType": "app",
      "url": "<% 'accessProvisioningRequests/' + queryParams.requestId %>",
      "httpMethod": "PUT",
      "authType": "sso",
      "onSend": "<%
        var allRows = detailsGrid.getRows();
        var retainedIds = [];
        for (var r : allRows) {
          if (!r.isSelected()) {
            retainedIds.add({'id': r.get('childBOColumn').value});
          }
        }
        return {
          'roleAssignments': retainedIds
        };
      %>"
    }
  ]
}

Invoking a Bulk or Per-Row Delete on Page Submit

If each grid row is an independent top-level Business Object record without a parent wrapper, collect the IDs of the selected rows via detailsGrid.getSelectedRows() and pass them to your outbound delete endpoint or synchronous orchestration when the user submits the page, rather than inside onRowSelect.

Pattern 2: Fixing Parallel Multi-Instance Arrays Collapsing into One Grid Row on Edit Pages

A common data modeling pitfall occurs when a developer creates a single Business Object to store a multi-row grid by defining separate multi-instance fields for each column—for example, roleBasedwID[], roleBasedSgName[], and supervisoryOrganization[]—all on the same Business Object instance.

When the user creates a request with two grid rows, Workday saves the values into those three parallel arrays on a single Business Object record. When the Edit page loads and queries the Business Object via a GET endpoint (editSecurityPackage), the response contains a single element in data:

json
{
  "data": [
    {
      "workdayID": "44349cf173149000d87bd095d6370000",
      "name": "CGJWBCJ",
      "roleBasedwID": [
        { "wID": "00707eaf108343a081a3f0a694743e67" },
        { "wID": "376a21a116974c789f80629966270730" }
      ],
      "roleBasedSgName": [
        { "name": "HR Partner" },
        { "name": "Alternate Owner" }
      ],
      "supervisoryOrganization": [
        {
          "supervisoryOrganization": [
            { "id": "e02485f863ec48d39a082bb95cc4abe4", "descriptor": "Human Resources" },
            { "id": "e50d309a6d8540e3b533219cfa2c330b", "descriptor": "Information Technology" }
          ]
        },
        {
          "supervisoryOrganization": [
            { "id": "e7dcf5926bdc40d6b6877f41f4c15387", "descriptor": "Accounting Operations" }
          ]
        }
      ]
    }
  ]
}

If you bind the Edit page grid’s rows attribute to <% editSecurityPackage.data %>, the grid sees a 1-element array (data[0]) and renders only a single row, collapsing all values from every parallel array into that one row.

Rebuilding Grid Rows by Zipping Parallel Arrays with .map()

To render one row per entry when your data is stored in index-aligned parallel arrays on data[0], use .map((item, i) => ...) in the grid’s rows binding to zip the parallel arrays at index i into an array of row objects:

json
{
  "type": "grid",
  "id": "roleBasedSecurityGroupsGridId",
  "label": "Role Based Security Groups",
  "gridType": "LIST",
  "isArrayOutBinding": true,
  "rowVariableName": "roleBasedSecurityGroupData",
  "rows": "<%
    empty(editSecurityPackage.data) ? [] :
    editSecurityPackage.data[0].roleBasedwID.map((wIDObj, i) => {
      {
        'securityGroup': {
          'id': wIDObj.wID,
          'descriptor': editSecurityPackage.data[0].roleBasedSgName[i].name
        },
        'suporgs': editSecurityPackage.data[0].supervisoryOrganization[i].supervisoryOrganization
      }
    })
  %>",
  "columns": [
    {
      "type": "column",
      "columnId": "sgCol",
      "label": "Security Group",
      "cellTemplate": {
        "type": "instanceList",
        "id": "sgInstanceList",
        "multiSelect": false,
        "selectedValuesAndDescriptors": "<% [roleBasedSecurityGroupData.securityGroup] %>"
      }
    },
    {
      "type": "column",
      "columnId": "supOrgCol",
      "label": "Supervisory Organizations",
      "cellTemplate": {
        "type": "instanceList",
        "id": "supOrgInstanceList",
        "multiSelect": true,
        "selectedValuesAndDescriptors": "<% roleBasedSecurityGroupData.suporgs %>"
      }
    }
  ]
}

Note how each instanceList inside cellTemplate binds selectedValuesAndDescriptors to its own row’s zipped slice ([roleBasedSecurityGroupData.securityGroup] for single-select and roleBasedSecurityGroupData.suporgs for multi-select) rather than referencing the entire parent array.

Long-Term Data Model Recommendation

Zipping parallel arrays works only as long as every array (roleBasedwID[i], roleBasedSgName[i], supervisoryOrganization[i]) remains strictly index-aligned and no optional column is omitted on a row. Whenever possible, model each grid row as its own Child Business Object record linked to the parent via a multi-instance relationship field so rows binds directly to the child collection without manual array reconstruction.

How to Verify in the Tenant

  1. Open the Create page in your Workday Extend tenant, add three rows to the grid with distinct single-select and multi-select instanceList values, and click OK to save the record.
  2. Open the Edit page for the saved record and verify that the grid expands into three separate rows with each row’s instanceList pre-populated with its exact saved selections.
  3. Select one row for removal, submit the Edit page, and re-open the record to confirm the removed row is no longer linked to the Business Object instance.

Sources checked

Related guides

All guides

Let Workday check the work.

Kiweely writes WQL and builds orchestrations in your own tenant, and Workday, not Kiweely, says whether they passed.

Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.

We’ll email you once to confirm. Unsubscribe in one click from any issue.