Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Write plugin on publish of an entity

$
0
0

Hi,

I've created plugin for CRM 2011 there is nothing I am doing in the plugin only adding the required services and I've register the plugin with following of the information:-

Message:- Publish
Primary Entity:- None
Secondary Entity:- None

But it generates the following exception .

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Saved_Query_on_Publish.Class1.Execute(IServiceProvider isp) in C:\Users\shakeel.ishaq\Desktop\Wahaj\Saved Query on Publish\Saved Query on Publish\Class1.cs:line 22Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"><ErrorCode>-2147220891</ErrorCode><ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic"><KeyValuePairOfstringanyType><d2p1:key>CallStack</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)</d2p1:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><d2p1:key>OperationStatus</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value></KeyValuePairOfstringanyType></ErrorDetails><Message>System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Saved_Query_on_Publish.Class1.Execute(IServiceProvider isp) in C:\Users\shakeel.ishaq\Desktop\Wahaj\Saved Query on Publish\Saved Query on Publish\Class1.cs:line 22</Message><Timestamp>2014-03-04T12:55:04.7285261Z</Timestamp><InnerFault i:nil="true" /><TraceText>

[Saved Query on Publish: Saved_Query_on_Publish.Class1]
[ce44b526-99a3-e311-8241-00155d002947: Saved_Query_on_Publish.Class1: Publish of  any Entity]


</TraceText></OrganizationServiceFault>
I want to seek your kind help and suggestion in this regard to run the code on to the track.


Viewing all articles
Browse latest Browse all 8223

Trending Articles