I'm creating a single-page application site in Power Pages and I have a custom Dataverse table (mytable) with a Contact-scope table permission (contactrelationship set to a lookup field pointing back to the current portal user) that is only partially working. The table permission has read: true, write: true, create: true.
What works
- GET /_api/mytable?$select=...&$filter=...
- Collection GET with OData filter works correctly and respects Contact-scope (only returns the current user's records)
- POST /_api/mytable
- Creating a new record with cd_Applicant@odata.bind: /contacts(...) works (204)
What fails
- PATCH /_api/mytable(guid)
- Always returns 500 / 9004010A, regardless of body content
- This is consistent with a known issue where GET /_api/mytable(guid) (direct by primary key) also returns 500 for Contact-scope tables
I have verified
- The CSRF token (__RequestVerificationToken) is valid
- A 401 test with an invalid token confirms the token mechanism works
- The Webapi/<table>/fields site setting has every field in the PATCH body explicitly listed (not *)
- Content-Type: application/json and OData-Version: 4.0 headers are present
- The record being PATCHed was created by the current portal user in the same session, so the Contact relationship is set correctly
- Reducing the PATCH body to a single simple field ({"status_field": 0}) still returns the same error
Is PATCH by primary key simply not supported for Contact-scope tables in Power Pages Web API, the same way GET by primary key is not supported? If so, what is the recommended pattern for updating an existing Contact-scope record from a portal SPA/Code Site?