Skip to content

Commit 5efd1be

Browse files
akshay-vizCopilot
andcommitted
docs(model-apps): troubleshoot a generative page that fails to render
`troubleshooting.md` covered a page that fails to UPLOAD and a page that does not APPEAR in the app, but nothing for a page that deploys and lists correctly and then fails at runtime. That gap is user-visible and lands on a cryptic Dataverse OData message: A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'. The maker sees "Failed to load generative page" while `pac model genpage list` and the sitemap both look correct, so the obvious next steps (re-upload, re-add to sitemap) are all wrong. The entry leads with the diagnostic rather than a fix, because the dialog shows the server's message but not the request that caused it — the failing `$filter` is what distinguishes the three causes, and nothing else can. It then documents the causes seen in practice: an `Edm.Guid` compared against a QUOTED literal (OData v4 GUID literals are unquoted), a Custom API parameter whose declared kind is missing or wrong so the host serializes it untyped, and a GUID still carrying the braces some Dataverse surfaces return. Documentation only — no behaviour change. This is not a fix for any specific report: the plugin's own scripts already interpolate GUIDs unquoted (asserted in sdk-build.test.js) and the sitemap reader requires a bare 36-char GUID, so the guidance is for diagnosing page code and platform payloads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42626da2-b66f-4162-acaa-b1127ef23d89
1 parent 22590cc commit 5efd1be

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

plugins/model-apps/references/troubleshooting.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,34 @@ This plugin creates **pages within existing** model-driven apps — it cannot cr
6363

6464
---
6565

66+
## Generative Page Fails to Render
67+
68+
Dialog: **"Failed to load generative page"**, carrying a Dataverse OData error such as:
69+
70+
> A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'.
71+
72+
The page itself deployed correctly — this is a **runtime data** failure, so `pac model genpage list` and the sitemap both still look right. Diagnose from the failing request, never from the dialog:
73+
74+
- **Capture the query first**: F12 → Network → filter `api/data` → find the 4xx response. Copy its `$filter` (or the request body for an `Execute`/action call). That one string decides which cause below applies; the dialog alone cannot distinguish them.
75+
76+
**Cause 1 — a GUID compared as a string.** Dataverse types record ids as `Edm.Guid`, and OData v4 GUID literals are **unquoted**. `accountid eq '<guid>'` raises the error above; `accountid eq <guid>` succeeds.
77+
78+
- Prefer `dataApi.retrieveRecord({ id })` over a hand-built `$filter` — it types the id for you (see `samples/10-detail-with-pageinput.tsx`)
79+
- The same applies to lookup columns (`_ownerid_value`), which are also `Edm.Guid`
80+
81+
**Cause 2 — a Custom API parameter whose declared kind is missing or wrong.** The host stamps the OData type from the *declared* kind, so an undeclared or mistyped parameter is serialized untyped and fails the same way.
82+
83+
- Declare every parameter in `parameterKinds` (see `references/custom-api.md`)
84+
- Pass a plain GUID-formatted string for a `Guid` kind — the platform wraps it into its typed form; do **not** wrap it yourself
85+
86+
**Cause 3 — a GUID carrying braces.** Some Dataverse surfaces return `{xxxxxxxx-xxxx-…}`. Strip the braces before using the value in a filter or as a parameter.
87+
88+
If the failing request comes from the page-**load** path rather than from code in the `.tsx`, this is a platform issue: capture the request and report it rather than editing the page.
89+
90+
See: <https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api>
91+
92+
---
93+
6694
## RuntimeTypes Issues
6795

6896
- Generate schema BEFORE uploading: `pac model genpage generate-types --data-sources "entity1" --output-file RuntimeTypes.ts`

0 commit comments

Comments
 (0)