Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Service forum

Where to find input/output parameters for a Plugin?

(0) ShareShare
ReportReport
Posted on by

hiya, does anyone know where to find the XRM documentation which tells me the input/output parameters for any of the plugin messages.

I'm interested in messages like Assign, Grant Access etc..  What parameters are expected to be found in the target ?

thanks a bunch,

Michelle

  

Categories:
  • Suggested answer
    Adrian Begovich Profile Picture
    1,019 Super User 2025 Season 1 on at
    RE: Where to find input/output parameters for a Plugin?

    Hi ShellyCodes,

    I recommend reading this article as it is helpful for understanding the data context passed to a plugin.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Where to find input/output parameters for a Plugin?

    Hi,

    Are you looking for what will be the return value of target? if yes, I don't this level of information is documented.This is something you need to try and find out.

    For grantaccess plugin, you can refer this blog: community.dynamics.com/.../plugin-triggered-when-share-unshare-crm-c

    What is your actual business requirement?

    Hope this helps.

  • Community Member Profile Picture
    on at
    RE: Where to find input/output parameters for a Plugin?

    hi Ravi, I'm sorry I didnt make it clear.

    How do we discover for any message what the required input parameters are ?  For example the GrantAccess message requires the target be filled and the principal access. Where is this documented?

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Where to find input/output parameters for a Plugin?

    Hi,

    The input parameter contains the entity instance (in most of the cases). To get the message name, you need to use context.MessageName. Here is the sample plugin with all the required properties:

    ============

    public void Execute(IServiceProvider serviceProvider)

           {

               if (serviceProvider == null)

                   throw new ArgumentNullException("serviceProvider");

               var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));

               var serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

               var tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));

               var service = serviceFactory.CreateOrganizationService(context.UserId);

               var adminService = serviceFactory.CreateOrganizationService(null);

               var messageName = context.MessageName.ToLowerInvariant();

               if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)

               {                

                   Entity targetEntity = (Entity)context.InputParameters["Target"];

                  // Your plugin logic

               }

           }      

    ============

    Hope this helps.

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Where to find input/output parameters for a Plugin?

    Hi partner,

    You could go to there to download SDK for dynamics 365(v9.x).

    Here is a sample about how to assign record.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/sample-assign-record-team

    Hope it helps.

    Best Regards

    Leo

  • Suggested answer
    Adrian Begovich Profile Picture
    1,019 Super User 2025 Season 1 on at
    RE: Where to find input/output parameters for a Plugin?

    Hi ShellyCodes,

    You can find a list of plugin messages in the Message-entity support for plug-ins Excel document found in the CRM SDK. The parameters in the target entity will vary based on the selected entity.

    In your plugin code, you can create an instance of the IPluginExecutionContext.

    IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));

    With the context, you can access all the input parameters that are transferred to the plugin.

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans