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"];
        }
    }
}

  • Matias Alfaro Profile Picture
    5 on at
    RE: Pre Operation plugin does not work

    Thanks i found other method for my problem :)

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

  • Suggested answer
    Torrado Profile Picture
    1,270 on at
    RE: Pre Operation plugin does not work

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans