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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Plugin Dynamics 365 CRM

(0) ShareShare
ReportReport
Posted on by 185

Hi,

I have a plugin registered (post-operation,synchronous) on create of a custom entity. In the plugin , I am trying to share (using some custom code) the record with another user. My problem is 

The code is throwing an exception as "the record with guid = {XXXXX-XXXXX-XXXX} you are trying to share doesn't exist". 

This is strange. Because, I registered plugin on post-operation. That means , after the record got created in DB, the plugin triggers.

Any idea why it's throwing exception ?

Also , another thing that I observed while debugging is , context.UserId and context.InitiatingUserId are showing same values through I registered plugin under different user.Here both are showing my Id i.e who is performing create record. Any idea on this ?  

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    Plugins are in transaction phase even in post. If any thing wrong happened then all changes will be revert back.

    You can try it with creating a plugin that throw exception and register in post create.

    You can not share a record until it get create. I suggest you to create a workflow instead of plug-in or register your plugin in asynchronous mode.

    For second point:

    Can you please share screen shot of your plugin step?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans