Hi all,
i'm having an issue in trying to Update an Entity, in particular, i want to update the active stage of an Opportunity in the BPF and i'm having the error:
'participating entity record of stage is not valid'
Here's the code i'm using:
newActiveStageId = (Guid)pathResp.ProcessStages.Entities[activeStagePosition].Attributes["processstageid"];
// Retrieve the process instance record to update its active stage
ColumnSet cols1 = new ColumnSet();
cols1.AddColumn("activestageid");
Entity retrievedProcessInstance = crmSvc.Retrieve("opportunitysalesprocess", processOpp1Id, cols1);
// Update the active stage to the next stage
retrievedProcessInstance["activestageid"] = new EntityReference("processstage", newActiveStageId);
crmSvc.Update(retrievedProcessInstance);
crmSvc.Update(...); is the line affected by the error.
I've not found any usefull suggestion about this kind of error, so if someone can help it would be great.
Thanks for anyone responding.