Why PATCH fails with unrecognized field: <fieldName> from a PMD page when Postman succeeds
After adding new TEXT or SINGLE_INSTANCE fields to a Workday Extend Model Business Object (MBO), submitting an edit page or microEdit page via an outbound PATCH endpoint (https://api.us.wcp.workday.com/apps/{appId}/v1/customRecords/{recordId}) can fail with HTTP 400 Bad Request and unrecognized field: <fieldName>.
This failure is especially confusing when:
- Querying the new fields in
WQL(SELECT crFieldB FROM customApp_a1b2c3_customRecords) works without error. - Every field on the Business Object shares the exact same
defaultSecurityDomainsand field-level security policy. - Copying the JSON payload and sending a
PATCHrequest directly from Postman to the exact same URL and record ID succeeds with HTTP200 OKand saves the values.
Because the page endpoint uses "authType": "sso" while Postman uses an OAuth Bearer token, it is easy to mistake this for an SSO-vs-Bearer authentication bug. In practice, two distinct mechanisms cause a PMD PATCH request to fail with unrecognized field while Postman succeeds:
- PMD
valueOutBindingmerges hidden or misspecified widget bindings intoself.data: Before executing your outbound endpoint’sonSendscript, the PMD runtime automatically collects every widget on the page (or parent page/micropage hierarchy) whosevalueOutBindingtargets that endpoint name and merges those keys intoself.data. If a widget has a typo in itsvalueOutBindingpath, binds to the wrong endpoint, or outputs a nested wrapper object,self.datacontains extra keys that you did not manually construct. - SSO persona lacks
Modifypermission on a field-specific security domain: In the Extend Model Object REST API, if a specific field is secured by a security domain where the logged-inssopersona lacksModify(PUT/PATCH) access—while the API Client / ISU used in Postman hasModifyaccess—the schema validator for that persona rejects the restricted field in aPATCHpayload as an unrecognized/disallowed property.
Step 1: Log json:asJSON(self.data) inside onSend to inspect the true merged payload
Rendering a helper variable in a readOnlyText widget on the page before clicking submit does not show what valueOutBinding injects into self.data at submission time.
To see the exact object that PMD passes into the outbound endpoint, add console.debug(json:asJSON(self.data)); at the top of the endpoint’s onSend script:
{
"name": "patchCustomRecord",
"baseUrlType": "app",
"url": "<% 'customRecords/' + routeParams.recordId %>",
"httpMethod": "PATCH",
"authType": "sso",
"onSend": "<%
console.debug('Inbound self.data from valueOutBinding: ' + json:asJSON(self.data));
return self.data;
%>",
"failOnStatusCodes": [
{ "code": 400 },
{ "code": 403 },
{ "code": 404 },
{ "code": 500 }
]
}Open the browser / Extend developer console logs after reproducing the 400 error and inspect the logged JSON string. Look for:
- Field names with a casing mismatch (
crfieldBvs.crFieldB) introduced by a widget’svalueOutBinding. - Extra keys from read-only display widgets, search boxes, or grid helper columns (
isNewRow,descriptor, or nesteddataarrays) that were bound topatchCustomRecord. - Single-instance relationship fields where a widget bound a plain string
"3aa555..."instead of an object{"id": "3aa555..."}(or vice versa for aTEXTfield).
Step 2: Test a minimal single-field payload in onSend to isolate valueOutBinding vs. SSO security
Next, temporarily bypass self.data inside onSend and return a minimal hard-coded object containing only one of the failing fields:
"onSend": "<%
console.debug('Raw self.data: ' + json:asJSON(self.data));
var payload = {
'crFieldB': '1'
};
console.debug('Sanitized outbound payload: ' + json:asJSON(payload));
return payload;
%>"Outcome A: The minimal payload succeeds with 200 OK
If returning {'crFieldB': '1'} from onSend succeeds on the SSO page, the Business Object schema and SSO permissions are valid—the failure was caused by self.data carrying polluted properties from widget valueOutBinding declarations.
Fix the endpoint permanently by constructing and returning an explicit allow-listed JSON object inside onSend rather than returning self.data directly:
"onSend": "<%
var cleanPayload = {
'crFieldA': fieldAWidget.value ?? '',
'crFieldB': fieldBWidget.value ?? '',
'crFieldD': fieldDWidget.value ?? '',
'crFieldF': fieldFWidget.value ?? '',
'crFieldG': fieldGWidget.value ?? '',
'relatedWorker': empty(workerListWidget.value)
? null
: { 'id': workerListWidget.value[0] }
};
console.debug('Sending clean PATCH payload: ' + json:asJSON(cleanPayload));
return cleanPayload;
%>"Outcome B: Even {'crFieldB': '1'} fails with 400 unrecognized field on the SSO page
If the minimal single-field payload still fails under authType: "sso" while succeeding in Postman:
- Check Compare Postman User vs. SSO Persona: Verify whether your Postman OAuth token was generated for an Integration System User (
ISU) or an administrator, while the PMD page is being tested as a non-admin employee or manager. - Run Refresh Extend Model Component Cache in the tenant so the presentation runtime’s cached schema for the Business Object matches the REST API gateway’s schema.
- Inspect the
.bofile in your app source: check whethercrFieldBhas a field-level"securityDomains"array overriding"defaultSecurityDomains", and run Activate Pending Security Policy Changes after confirming the SSO user’s security group has Modify permission on that domain.
How to verify the fix in your tenant
- Open the PMD edit page or micropage signed in as the target SSO user persona, edit all newly added fields (
crFieldB,crFieldD,crFieldF,crFieldG), and submit the page. - Confirm in the developer console that
Sending clean PATCH payloadlogs a flat JSON object containing only declared Business Object fields and returns HTTP200. - Query the record in View WQL Query Result (
SELECT workdayID, crFieldB, crFieldD, crFieldF, crFieldG FROM <app>_customRecords WHERE workdayID = '<recordId>') to verify that every updated field value persisted in the tenant.