Hi,
I have a problem updating the process stages of opportunities in dynamics 365.
I have a process wich splits after a condition like the image below.
B is the condition based on a optionset with 2 values. If the value is "A" the upper business process flow continues, if it is "B" the lower one does.
When I now try to set the process stages to a specific one (I iterate over those before), everything works fine for the upper process flow. But if the condition matches "B", I get this result:
It seems as if the full process matching "A" gets completed and displayed despite I just iterate over the stages for the process part matching "B".
Here an excerpt of the code:
while (opportunity.StageId.Value.ToString() != opportunity.Ec4uPiaMigrationProcessStage) { if (opportunity.Ec4uArtVerkaufschance.Value == Opportunity.Options.Ec4uArtVerkaufschance.Vertriebspartner) { var nextStage = GetNextSalesStage(opportunity.StageId); if (nextStage != null) { var updateOppty = new Opportunity { OpportunityId = opportunity.OpportunityId, StageId = nextStage }; try { orgSvc.Update(updateOppty); opportunity.StageId = nextStage; } catch (Exception e) { Log.Error($"{e.Message}"); } } }
*This post is locked for comments