Dynamics 365 CRM Plugins Code Sample for Practice

Summary : Dynamics 365 CRM Plugins Code Sample for Practice

All we have started code samples for plugins you can download from the following link.

https://crmoncee.sharepoint.com/:f:/s/academic/EooJQ3KamatDo6HkjvaU9MQB8m-excku_dV4PolENH1EIQ?e=egxeIY




If you need any implementation help or Support. get in touch with us.

Contact US:

Email : info@crmonce.com
Phone: +91 9493916112
Skype for Business: umamahesh@crmonce.com



Dynamics 365 CRM Integrations Training & Support


Summary : Dynamics 365 CRM Integrations Training & Support

In this course we teach you about the integrations and basics of azure, Data Migration.

High Level Topics will be covered:

1. Azure trail setup & resource groups, subscription.
2. Azure Logic Apps, App services.
3. Developing the custom WebApi and deploying.
4. Azure Functions, Service bus, Azure Blob storage.
5. Consuming Webapi’s in Plugins.
6. Setup azure sql server, VM’s.



How to Restrict the deleting a record in Dynamics 365 Plugin

Summary:  How to Restrict the deleting a record in Dynamics 365 Plugin


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;
using System.ServiceModel;
using Microsoft.Xrm.Sdk.Query;

namespace Opportunity1
{
    public class OpportunityPreDelete : IPlugin
    {
        public void Execute(IServiceProvider serviceProvider)
        {
            // Obtain the execution context from the service provider.
            IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            // Obtain the organization service reference.
            IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            IOrganizationService service = factory.CreateOrganizationService(context.UserId);
            if (context.InputParameters.Contains("Target") && (context.InputParameters["Target"] is EntityReference))
            {
                if (context.MessageName == "Delete")
                {
                    throw new InvalidPluginExecutionException("opportunity deletion not allowed");
                }
            }

        }

    }
}


If you need any implementation help or Support. get in touch with us.

Contact US:

Email : info@crmonce.com
Phone: +91 9493916112
Skype for Business: umamahesh@crmonce.com


Popular Posts