FYI to the community, it looks like we have a bug in the latest Dataverse release (9.2.21104.147) related to the API message RetrievePrincipalAccessRequest.
Using a well-formed request message which worked prior to latest release, orgService.Execute now throws an unhandled null dereferencing exception. This error is further demonstrated by using a RetrieveSharedPrincipalAccessRequest message to retrieve a set of rows which should be valid for RetrievePrincipalAccessRequest, yet all of them still throw the same exception. This is observed in plugin execution context as well as when using an authenticated console app connecting with the proxy service.
To reproduce:
- retrieve all principals with access to a given target with RetrieveSharedPrincipalsAndAccessRequest
- loop though principals and use the response to call RetrievePrincipalAccessRequest
*Throws an unhandled null dereferencing exception inside orgService.execute
var request = new RetrieveSharedPrincipalsAndAccessRequest
{
Target = entityRef
};
var response = (RetrieveSharedPrincipalsAndAccessResponse)orgService.Execute(request);
foreach(var access in response.PrincipalAccesses)
{
var otherRequest = new RetrievePrincipalAccessRequest
{
Target = entityRef,
Principal = new EntityReference(access.Principal.LogicalName, access.Principal.Id)
};
var otherResponse = (RetrievePrincipalAccessResponse)orgService.Execute(otherRequest);
}
The workaround for this is implicit in the proof of the bug. Instead of using RetrievePrincipalAccessRequest, one needs to use RetrieveSharedPrincipalsAndAccessRequest instead, then loop through the results to find the expected Principal. This is a valid workaround, but should not be necessary as this is a breaking change to a well-established API message.


Report
All responses (
Answers (