by Carmel Schvartzman
- This is the Building Block C# code to create the CRM Organization Service in a CRM 2013 Workflow.
- The present code relates to a custom Plugin / Workflow in Dynamics CRM 2011/2013. Once you have developed your custom workflow, you deploy the assembly containing the plugin in the CRM web server, and register it with the Plugin Registration Tool of the CRM 2011 SDK.
- Then you use this code to set up the Xrm Organization Service that you need to interact with the CRM organization:
protected override void Execute(CodeActivityContext context)
{
#region GET THE EXECUTION CONTEXT FROM THE SERVICE PROVIDER VARIABLE :
execContext = context.GetExtension<IExecutionContext>();
workflowContext =
context.GetExtension<IWorkflowContext>();
serviceFactory =
context.GetExtension<IOrganizationServiceFactory>();
service =
serviceFactory.CreateOrganizationService(workflowContext.UserId);
ITracingService tracingService = context.GetExtension<ITracingService>();
#endregion
///////////////////////////////////////////////////////////////////////////////////////////
// Business Logic:
ExecuteYourBussinessLogicMethod(context, workflowContext, tracingService);
//////////////////////////////////////////////////////////////////////////////////////////
}
That's all...Enjoy Dynamics CRM 2013
כתב: כרמל שוורצמן