Generic JavaScript Functions to Associate and Disassociate Dataverse records using the Power Pages Web API


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

michelcarlo
michelcarlo
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.

Author: michelcarlo

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.

Share This Post On
Share via
Copy link
Powered by Social Snap