In my previous post Creating and removing N:N relationship between Dataverse records using Javascript and Power Pages Web API I showed how we can leverage the Power Pages Web API to handle single N:N associate and disassociate requests for a custom N:N relationship between Accounts and Contacts.
In case we want to extend that to be more generic to any N:N relationship we can leverage a custom function that can be used in multiple pages easily.
Prerequisites
- All required fields (including the N:N relationship name) in the code must be enabled for the WebAPI for the Power Pages site where you wish to run the code creation via Web API
- The WebAPI Wrapper code must be added to the page you are using the JavaScript code
- An N:N relationship between two tables you want to handle programmatically needs to be configured in Dataverse
Refactored Generic Versions of the functions
Following the principles explained in the previous post we can create more generic JavaScript…
Source link
More About This Author
-
SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff).
Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.
Array
- Modern Workplace8 May 2024How to create Microsoft Teams private channels using Power Automate and the ‘Send a Microsoft Graph HTTP request’ action
- Modern Workplace1 May 2024Using the new ‘Send a Microsoft Graph HTTP request’ action in Power Automate to send urgent messages in Microsoft Teams
- Modern Workplace13 April 2024Power Pages and Cloud Flows – Validate user against Dataverse records based on Contact ID
- Modern Workplace6 April 2024Download SharePoint library files in Power Pages with JavaScript and Cloud flows – Improved code using jQuery & option to open PDF file in a new tab