Hi,
I have a plugin that is registered on update message post operation. I am doing some related record associations and everything works correct. Except that the field(status) on the entity that plugin is triggered needs to be updated to a value so that we know plugin has worked correctly. Its a lookup field and I am updating something like this:
Entity entity = (Entity)context.InputParameters["Target"];
if (context.PrimaryEntityName == "new_case")
{
if (entity.Contains("new_trigger"))
{
try
{
//some code here and then..
EntityReference incidentstatusId = new EntityReference("new_status", someGuid);
entity.Attributes["new_incidentstatus"] = incidentstatusId;
service.Update(entity);
}
}
}
So instead of updating the field value at the end of plugin execution, it is throwing this error.
This workflow job was canceled because the workflow that started it included an
infinite loop. Correct the workflow logic and try again.
What could be the reason? Is it because service.update again triggers the same plugin?
someone please guide me through this. Thanks.
*This post is locked for comments
I have the same question (0)