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 365 | Integration, Dataverse...
Suggested Answer

Plugin creates team, assigns role and assign record to team returning missing privilege error

(0) ShareShare
ReportReport
Posted on by 193

Hi,

I am writing a plugin which creates a team and assigns 2 security roles to the team. Then I want to assign a custom entity record (ExternalEvent record) to the team. 

The team is created successfully and the roles are added to the team however the AssignRequest is returning an error:

An error occurred in AssignExternalEvent: Principal team (Id=fd4649b7-25fc-eb11-94ef-0022489c99de, type=9, teamType=0, privilegeCount=0), is missing prvRead####externalevent privilege (Id=f66c6482-ff2f-48ed-97b1-ae27b1a46dc6) on OTC=10831 for entity '#######' (LocalizedName='External Event') in Business Unit (Id=9eeca179-31e2-e911-a84a-000d3ab18578). context.Caller=2af029a0-0e6b-42a6-b8cb-c84539733ed8. Or identityUser.SystemUserId=67ee664f-b847-4c12-b2d3-a70251384660, identityUser.Privileges.Count=7059, identityUser.Roles.Count=0 is missing prvRead####_externalevent privilege (Id=f66c6482-ff2f-48ed-97b1-ae27b1a46dc6) on OTC=10831 for entity '#######t' (LocalizedName='External Event')

If I remove the AssignRequest from the plugin, it works successfully; the team is created with the right roles and I am able to assign the record to the team from the UI.

This is the plugin code:

                            service.Associate(
                                        "team",
                                        ownerteamid,
                                        new Relationship("teamroles_association"),
                                        new EntityReferenceCollection() { new EntityReference("role", roles.Entities[0].Id), new EntityReference("role", roles.Entities[1].Id) });
                            AssignRequest a = new AssignRequest
                             {
                                 Assignee = new EntityReference("team", ownerteamid),
                                 Target = new EntityReference(extEvent.LogicalName, extEvent.Id)
                             };
                             service.Execute(a);

Any ideas on how to fix this please?
thanks.
I have the same question (0)
  • SarahMoustafa Profile Picture
    25 on at

    Hi,

    Check for which user the plugin's context is running. If not System Administrator, check the user's privilege for ExtEvent entity.

    You can also double check the team's privilege for ExtEvent entity. Just in case the previous point wasn't the root cause.

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at

    Hi kelly,

    Try changing your plugin Execution Mode from Synchronous to Asynchronous, if it doesn't impact your process.

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 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 47

#2
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 32 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans