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

SetState Message is Not getting triggered in CRM 2011 Plugin

$
0
0

I created a plugin that successfully gets fired when I update a particular CustomEntity, but within that Plugin Code, I Set the State of another Custom Entity and I am trying to get the SetState Message to fire, but it doesn't seem to reach my plugin code.  When I manually go to that Entity, I can see that the State got appropriately updated, but the Plugin didn't get triggered.  In that Entity, I have Steps for SetState and SetStateDynamicEntity.  Below is my code to update my State:

*****Code Snippet ****

OptionSetValue statusCode = new OptionSetValue(2); // Posted
OptionSetValue stateCode = new OptionSetValue(1); // Inactive

EntityReference moniker = new EntityReference();
moniker.LogicalName = "prostr_purchasetransaction";
moniker.Id = new Guid(purchaseTransactionId);

OrganizationRequest request = new OrganizationRequest() { RequestName = "SetState" };
request["EntityMoniker"] = moniker;
request["State"] = stateCode;
request["Status"] = statusCode;

OrganizationResponse response = service.Execute(request);
******* End of Code Snippet  ******

 Any assistance would be greatly appreciated!!!!!

 


Viewing all articles
Browse latest Browse all 82002

Trending Articles



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