Created
November 29, 2021 09:27
-
-
Save maestrotex/d017b4ea111b793e9f00224bd462cd41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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