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

Community site session details

Session Id :
Dynamics 365 general forum

Does anyone know how to create a Custom Activity Entity when a Plugin installs?

(0) ShareShare
ReportReport
Posted on by

I'm able to create a Custom Activity Entity using the CreateCustomActivityEntity from the Microsoft.Crm.Sdk.Samples. I've then written a Plugin that works great with the Custom Activity. What I can't figure out is how to create the Customer Activity when the Plugin installs.

<WILL ADD CODE ON EDIT>

Does anyone have an examples of his this might work?

Any help is much appreciated! Thanks!

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at
    RE: Does anyone know how to create a Custom Activity Entity when a Plugin installs?

    Hi Dumber_Texan2,

    This article will teach you how to create a custom entity programmatically.

  • Community Member Profile Picture
    on at
    RE: Does anyone know how to create a Custom Activity Entity when a Plugin installs?

    Since I can't edit this, here is the code I have tried.

    //Check to see if My Entity exists
                    var entityRequest = new RetrieveEntityRequest
                    {
                        EntityFilters = EntityFilters.Entity,
                        LogicalName = "new_myentity",
                        RetrieveAsIfPublished = true
                    };
    
                    var entityResponse = (RetrieveEntityResponse)service.Execute(entityRequest);
                    EntityMetadata MyEntity = entityResponse.EntityMetadata;
    if (MyEntity == null)
    {
     //Create Custom Activity
    }

    //Obtain the target entity from the input parameters.
                    Entity entity = (Entity)context.InputParameters["Target"];
    
                    // Verify that the target entity represents My Entity.
                    // If not, this plug-in was not registered correctly.
                    if (entity.LogicalName != "new_myentity")
                        return;


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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans