Skip to content

Instantly share code, notes, and snippets.

@maestrotex
Created November 29, 2021 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maestrotex/d017b4ea111b793e9f00224bd462cd41 to your computer and use it in GitHub Desktop.
Save maestrotex/d017b4ea111b793e9f00224bd462cd41 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;
namespace Sample_Plugin
{
public class CustomActionCall : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
IPluginExecutionContext context =
(IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory =
(IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service =
factory.CreateOrganizationService(context.UserId);
var MyInputParam = (string)context.InputParameters["MyInputParam"];
context.OutputParameters["MyOutputParam"] = "This is output parameter";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment