Question Status

Suggested Answer
Sai Chaitanya asked a question on 25 Mar 2014 8:35 PM

Hi ,

I have been using this workflow from past sometime and made few changes in this week after the changes there were some issues with this workflow .All I get is this error . All I have been doing is update a optionsetValue,Datetime field and string field on CRM .Also When I tried to look at all the values which I have been updating are not null or empty .I have some values coming in them for updating on CRM .

"Entity Id must be the same as the value set in property bag"

Plugin Trace:

[MTC.NetprospexWorkFlow: MTC.NetprospexWorkFlow.Class]

[MTC.NetprospexWorkFlow (1.0.0.0): MTC.NetprospexWorkFlow.Class]

Error Message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Entity Id must be the same as the value set in property bagDetail:

<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">

 <ErrorCode>-2147220989</ErrorCode>

 <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">

   <KeyValuePairOfstringanyType>

     <d2p1:key>ValidationPath</d2p1:key>

     <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">/0</d2p1:value>

   </KeyValuePairOfstringanyType>

 </ErrorDetails>

 <Message>Entity Id must be the same as the value set in property bag</Message>

 <Timestamp>2014-03-26T03:20:37.8444956Z</Timestamp>

 <InnerFault>

   <ErrorCode>-2147220970</ErrorCode>

   <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />

   <Message>System.ArgumentException: Entity Id must be the same as the value set in property bag

Parameter name: Target</Message>

   <Timestamp>2014-03-26T03:20:37.8444956Z</Timestamp>

   <InnerFault i:nil="true" />

   <TraceText i:nil="true" />

 </InnerFault>

 <TraceText>[MTC.NetprospexWorkFlow: MTC.NetprospexWorkFlow.Class]

[MTC.NetprospexWorkFlow (1.0.0.0): MTC.NetprospexWorkFlow.Class]

</TraceText>

</OrganizationServiceFault>

  at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Update(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)

  at Microsoft.Crm.Extensibility.InprocessServiceProxy.UpdateCore(Entity entity)

  at MTC.NetprospexWorkFlow.Class.ContactMatch()

  at MTC.NetprospexWorkFlow.Class.Execute(CodeActivityContext executioncontext)

  at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

  at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)


Reply
Suggested Answer
Pramod Modvathodi responded on 25 Mar 2014 8:52 PM

Can you please give your code here? It seems to be that the id mismatch between the id in property bag and  entity id you have provided to update differs.

Reply
Suggested Answer
Pramod Modvathodi responded on 25 Mar 2014 8:52 PM

Can you please give your code here? It seems to be that the id mismatch between the id in property bag and  entity id you have provided to update differs.

Reply
Sai Chaitanya responded on 25 Mar 2014 11:36 PM

Please check my code here :

http://pastebin.com/cXNV46ZK

Reply
Pramod Modvathodi responded on 26 Mar 2014 12:18 AM

I suggest that you set the contact id at the top rather than setting it in each of the condition (this will avoid any confusion)

I have some questions for you

1) Why you are creating another update contact object when you have retrieved contact object which you are doing a for each loop.

2) What is the event in which the plugin is registered / where the code is written?

3) Can you point the line where the error is occurring (there is lot of code) it will be helpful.

Reply