Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Plugin class extension :does not implement interface member 'Microsoft.Xrm.Sdk.IPlugin.Execute(System.IServiceProvider)

$
0
0

Hi,

Kindly below code for auto number and it shows error on red mark text.

using System;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;

namespace crmpackageplugin.accautonumber
{
public class autonumberplugin :IPlugin
{
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"];
QueryExpression query = new QueryExpression("account");
query.ColumnSet = new ColumnSet(true);
EntityCollection result = service.RetrieveMultiple(query);
int totalrecords = result.Entities.Count;
var finalresult = totalrecords + 1;
int series = 1000;
entity.Attributes["new_autonumber"] = series + finalresult;
}
}
}
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>