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

Pre Operation plugin does not work

(0) ShareShare
ReportReport
Posted on by 5

Hello!

I have a Pre Operation plugin which is executed when creating a record of a "PP" entity (this entity is created by another Post Operation plugin, it is executed when creating an "AP" entity), this Pre Operation plugin copies information from "AP "to" PP ", but it is not working.

if (oEntityContext.Contains("AP"))
{
    EntityReference AP = (EntityReference)oEntityContext["AP"];
    Entity Eap = oService.Retrieve(AP.LogicalName, AP.Id, new ColumnSet("data1", "data2", "data3", "data4"));

    if (Eap.Contains("data1") || Eap.Contains("data2") || Eap.Contains("data3") || Eap.Contains("data4"))
    {
        if (Eap.Contains("data1"))
        {
            oEntityContext["data1"] = Eap["data1"];
        }
        if (Eap.Contains("data2"))
        {
            oEntityContext["data2"] = Eap["data2"];
        }
        if (Eap.Contains("data3"))
        {
            oEntityContext["data3"] = Eap["data3"];
        }
        if (Eap.Contains("data4"))
        {
            oEntityContext["data4"] = Eap["data4"];
        }
    }
}

I have the same question (0)
  • Suggested answer
    Torrado Profile Picture
    1,270 on at

    Hello Matias,

    Why having the Plug-in registered on Pre-Operation and not on Post-Operation?

    On Pre-Create the record is not yet created, so you don't have a record Id to execute that Retrieve (line 4).

    Hope this helps you.

    Please mark the answer as verified if helpful. That will help others in future.

  • Matias Alfaro Profile Picture
    5 on at

    Thanks i found other method for my problem :)

    I separathed the logic of Plug-in in Pre-Operation and Post-Operation.

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
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans