Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

No plugins have been selected from the list. Please select at least one and try again.....

(0) ShareShare
ReportReport
Posted on by 194

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

  • Verified answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: No plugins have been selected from the list. Please select at least one and try again.....

    Hi Amit,

    In this code, IPlugin interface is missing hence it is not showing the plugin while registration. Please add it as follows while instantiating a class public class CustomerIntegration : IPlugin.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans