Posts

Showing posts from October, 2023

How to Create a Business Process Flow and Get active stage of record and Update the Stage using C# in D365:

 Create a Business Process Flow                 Ex:  apy_ businessprocessflow           On Create of Contact record Create a business process flow and Get active stage and Set the Stage     Register Plugin on Create of Contact Entity                    using Microsoft.Xrm.Sdk;           using System;  namespace APY.Plugins.Sales {     public class ManageContact : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             ITracingService tracer = (ITracingService)serviceProvider.GetService(typeof(ITracingService));             IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));             IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));             IOrganizationService service = factory.CreateOrganizationService(null);              if (context.MessageName == "Create" && context.Sta