Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Create opportunity from separate entity and automatically navigate business process flow stage

Posted on by 105

Currently the client uses the opportunity business process flow with 9 stages.

They have requested a new custom entity named 'Proposal' that includes a ribbon button that, when pushed, creates a new opportunity record with copied over fields, that is automatically sets stage 5 to be the active stage.

My issue is, I'm unsure the best approach for implementing this change. I have no problem with creating new records using javascript, but it is automatically setting the opportunity to stage 5 that is giving me trouble.

Would anyone have any guidance that could point me in the right direction what is the best way to set this up.

The order of customization methods that would be most ideal for me would be:

1. Workflows 

2. Javascript

3. Power Automate

4. C# plugin

Thanks

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create opportunity from separate entity and automatically navigate business process flow stage

    Hi AMD99,

    You can refer following steps to achieve it:

    1. Workflows

    --Dynamics-365-Workflow-Tools has one action-Set Process Stage,This action is for changing the current stage of the active process of the record.

    Dynamics-365-Workflow-Tools/Set Process Stage.md at master · demianrasko/Dynamics-365-Workflow-Tools · GitHub

    (1)Download the solution and import it:

    Releases · demianrasko/Dynamics-365-Workflow-Tools · GitHub

    (2)Create one workflow on opportunity entity:

    Trigger and actions

    pastedimage1659513494325v6.png

    pastedimage1659511826800v2.png

    pastedimage1659512465088v4.png

    (3)save and active it

    2. Javascript

    formContext.data.process.setActiveStage(stageId, callbackFunction);

    setActiveStage (Client API reference) in model-driven apps - Power Apps | Microsoft Docs

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans