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 CRM (Archived)

How can I call a plugin which inherits from IPlugin wihout JS

(0) ShareShare
ReportReport
Posted on by

I encountered the following code which solves my problem but I do not know how to call it in the Dynamics 365 system. I registered it using Plugin Deployer. However, I cannot see it in the steps section.

 public class ReadAnnotation : IPlugin
 {
 public void Execute(IServiceProvider serviceProvider)
 {
 IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
 IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
 IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
 ...
}
}

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I should add that in the Plugin Deployer the plugin is named (Plugin) Name - Isolatable whereas other plugins that we develop are named (Workflow activity) Name - Isolatable.

  • gdas Profile Picture
    50,091 Moderator on at

    Can you please tell me what you are trying to achieve with the plugin. Did you register your plugin using plugin registration tool? If not then you should register your plugin first in which event (messages like create , update etc ) you want to register your plugin -

    docs.microsoft.com/.../tutorial-write-plug-in

    Once you register your plugin you need to trigger the same  event  , let say create record or update record using javascript , your plugin will automatically trigger.

  • Community Member Profile Picture
    on at

    I registered the plugin using the plugin registration tool. However, in the tool it is written that I registered a plugin not a workflow activity. And when I create a workflow in the CRM I cannot seem to find the plugin in the steps.

  • Suggested answer
    Swetha Poojary Salaskar Profile Picture
    326 on at

    HI

    Did you added strong name key to your plugin project? if not then please add it.

    Refer steps below:

    1.In Solution Explorer, open the shortcut menu for the project, and then choose Properties.

    2.Choose the Signing tab.

    3.Select the Sign the assembly box.

    4.In the Choose a strong name key file box, choose <Browse…>, and then navigate to the key file. To create a new key file, choose <New…> and enter its name in the Create Strong Name Key dialog box.

    Reference URL:

    https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-sign-an-assembly-with-a-strong-name

    Thanks,

    Swetha

    If found useful, please mark the answer as verified

  • Community Member Profile Picture
    on at

    I already did. Something else must be the problem.

  • Suggested answer
    Sreevalli Profile Picture
    3,256 on at

    Hi,

    You cannot use a plugin in workflows, we need to create workflow activity by inheriting "CodeActivity". see the sample workflow code - docs.microsoft.com/.../sample-create-custom-workflow-activity

    after that register your workflow same as plugin then you must be able to see the step under your arm workflow.

  • Suggested answer
    Rajesh Chungath Profile Picture
    467 on at

    Plugins will not available as workflow steps. Please create a workflow code activity and register it using plugin registration tool. Then you can use it on workflow steps.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans