You can bypass custom plugin logic, but you need permissions to do so

By | February 21, 2025

As you are probably aware, you can bypass custom plugin execution logic in your code by adding this kind of code:

request.Parameters.Add(“BypassBusinessLogicExecution”, “CustomSync,CustomAsync”);

This is as per the link below:

Bypass custom Dataverse logic – Power Apps | Microsoft Learn

What I did not realize, though, is that the user account running this code needs an addition permission to be given to it. Of course that’s not a problem for system admins, but, otherwise, you need to give that permission somehow.

The permission itself is described at the same page referenced above, but, unfortunately, it’s not exposed in the admin portal, so you can’t set it in the user interface.

You can do it quickly, though, by opening your model-driven application in the browser, and, then, running the following code in the browser’s dev tools. Just make sure to replace <role id> with the id of the role you need to give this privilege to:

fetch(' https://<org name>.dynamics.com/api/data/v9.2/roles(<role id>)/Microsoft.Dynamics.CRM.AddPrivilegesRole', {
  method: 'POST',
  body: JSON.stringify({
  "Privileges": [
    {
      "PrivilegeId": "0ea552b0-a491-4470-9a1b-82068deccf66",
      "Depth": "3"
    }
  ]
}
),
  headers: {
    'Content-type': 'application/json; charset=UTF-8'
  }
}).then(res => console.log(res)

Leave a Reply

Your email address will not be published. Required fields are marked *