web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retrieve all users a record is shared with in D365 using WebApi.execute and "RetrieveSharedPrincipalsAndAccess" function

(0) ShareShare
ReportReport
Posted on by 122

Hi All,

I am trying to get all the users or teams to with whom the current record is shared. Am trying to achieve this using the Xrm.Webapi.execute method and the unbound function


<Function Name="RetrieveSharedPrincipalsAndAccess">
<Parameter Name="Target" Type="mscrm.crmbaseentity" Nullable="false" />
<ReturnType Type="mscrm.RetrieveSharedPrincipalsAndAccessResponse" Nullable="false" />

Am using the below piece of code to get the list on account load.
function RunAction() {
var Id = Xrm.Page.data.entity.getId().replace('{', '').replace('}', '');
var target = {entityType:"account",id:Id};

var req = {};
req.Target = target;
req.getMetadata = function () {
return {
boundParameter: undefined,
operationType: 1,
operationName: "RetrieveSharedPrincipalsAndAccess",
parameterTypes: {
"Target": {
typeName:"mscrm.crmbaseentity",
structuralProperty: 5
}
}
};
};

Xrm.WebApi.online.execute(req).then(
function (data) {
var e = data;
debugger;
},
function (error) {
debugger;
var errMsg = error.message;
}
);
}

At run time am getting the exception Resource not found for the segment 'RetrieveSharedPrincipalsAndAccess'.
any clue what I am missing here ?

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans