Hello ,
here is one plugin written for integration of data from microsoft CRM 365 to Navision( on account entity)
when we create any account in ms crm 365 then same time data should copy in Navision .
while registering this plugin its giving following error-----No plugins have been selected from the list. Please select at least one and try again.....
i have tried changing plugins version also but same error is coming ...
Please help me out its urgent
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk;
namespace BlazeClan.CRM.NAV.IntgrationPlugin
{
public class CustomerIntegration
{
IOrganizationService service;
public void Execute(IServiceProvider serviceProvider)
{
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName == "account")
{
try
{
Guid accId = entity.Id;
string name = (string)entity.Attributes["name"];
string accNo = (string)entity.Attributes["accountnumber"];
var accCategory = ((OptionSetValue)entity.Attributes["accountcategorycode"]).Value;
string custType = "";
switch (accCategory)
{
case 1:
custType = "INTERNATIONAL";
break;
default:
custType = "DOMESTIC";
break;
}
CustomerCreate(accNo, name, custType);
}
catch (Exception ex)
{
throw new InvalidPluginExecutionException("An error occured in plugin. " + ex, ex);
}
}
}
}
public void CustomerCreate(string CustomerCode, string CustomerName, string CustomerType)
{
try
{
CustomerService.CustomerCRM obj = new CustomerService.CustomerCRM();
CustomerService.CustomerCRM_Service objSer = new CustomerService.CustomerCRM_Service();
objSer.Credentials = new System.Net.NetworkCredential("admin", "********");
objSer.Url = "">DESKTOP-U69UU3T:7047/.../CustomerCRM";
obj.Account_Code = "10000";// CustomerCode;
obj.Entry_No = 6;
obj.Account = CustomerName;
obj.Contact = "8877878787";
objSer.Create(ref obj);
}
catch (Exception ex)
{
ex.Message.ToString();
}
}
}
}
thanks
*This post is locked for comments