Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Problem updating process stages in dynamics 365

Posted on by 95

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.

0184.1.png

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:

0184.2.png

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

  • Verified answer
    mark_us Profile Picture
    mark_us 95 on at
    RE: Problem updating process stages in dynamics 365

    Got it - the TraversedPath Attribute needs to be set with all traversed stage guids separated by ","

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans