Repository navigation
Replies: 4 comments
|
Thanks for the report! This is a Dataverse platform constraint: intersect tables for N:N relationships do not support the standard Workaround — until we add first-class N:N support in the generated service, you can call the association endpoint directly via // Associate record1 (fromId) → record2 (toId) via the relationship
const dataverseUrl = "https://<your-env>.api.crm.dynamics.com";
await fetch(
`/api/data/v9.2/<from-table>s()/<relationship-name>/`,
{
method: "POST",
headers: { "Content-Type": "application/json", "OData-Version": "4.0" },
body: JSON.stringify({
"@odata.id": `/api/data/v9.2/<to-table>s()`
})
}
);To disassociate, use a We're logging this to our backlog to improve |
|
Sounds good, thank you! I wasn't sure if the "normal" Dataverse web API is fair game in code-apps, in terms of correctly inheriting the auth context, security roles etc., but I'm happy to hear that it is. In the interim I have gone with "manual" intersect tables with two N:1 relationships 🙈 |
|
I have tried using the Dataverse web api from the code app, but the Am I missing something? Looks like the IFrame is preventing fetches to pass through. Am I supposed to use something from the SDK? I can't see any methods for invoking a "general" API endpoint. |
|
Moving this to the ideas section. We still don't have a timeline for this. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
For an N:N relationship, the CLI allows to add the intersect table as a source. The generated service includes the usual methods. Attempting to create a new relation using the
create()method fails. Reading withgetAll()works.Code Apps documentation doesn't mention any limitations or recommendations around N:N relationships (that I could find).
Steps to Reproduce
pac code add-data-source -a dataverse -t <intersect-table-logical-name>Expected behavior
New record created in intersect table.
Actual behavior
Request fails with error message.
Screenshots or Error Messages
Environment information
All reactions