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!!!!!