Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Switch Business Process via workflow (v9)

(0) ShareShare
ReportReport
Posted on by 10

Hello,

I'm trying to set up a user journey whereby a record that is used in the last stage of a business process flow (Call it BPF 1) can be switched over to a new process flow (BPF 2) upon finishing the first flow, and ideally achieving this via a workflow.

Prior to v9 this could be achieved by calling the SetProcess action on the workflow, however this is now marked as depreciated. With the new structure to the business process flows where you can create a record for the new business process flow (which I understand is the replacement for SetProcess), I can create the new instance of the BPF and set the active stage, but because the entity in question was previously under BPF1, even though BPF2 gets created the entity record doesn't actually get switched to that flow automatically. The automatic switching over to the new flow still happens if you do use the SetProcess action, but with this being marked for being deprecated, does anyone know what the alternative is supposed to be in v9?

Thanks
Oliver

  • Suggested answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,321 on at
    RE: Switch Business Process via workflow (v9)
    Hi, 
    I tried reproducing this issue and here are my findings: 
    • Business Process Flows are now concurrent, this means, now different users have different BPFs active for the same record. For example, User A sees BPF1 and User B sees BPF2 on the same record. Even when User A switches to BPF2, it is possible User C still sees BPF1 (this is expected behavior). 
    • It is mentioned in the documentation, that while creating a record if you pass PorcessId, the BPF is switched (from default), you can also skip choosing a BPF if you pass an empty GUID. However, as per my understanding, this works while creating records, and that too in On-Premise. 
    • Now to switch it in online for all users, I have gone through some similar threads and found out: 
      • Use a javascript function onLoad of the form and switch the BPF using client API. You can store the active BPF's GUID in a field and switch the BPF accordingly. 
      • Use plugin/custom code activity to set the BPF for all users, you can see this in the following thread: 
    • Or use the following tool: 
    I did not test the above solution, please try and let me know if you face any issues. 
  • OliverC Profile Picture
    OliverC 10 on at
    RE: Switch Business Process via workflow (v9)

    Hi Wahaj,

    The steps you are describing are to trigger the business  process flow against the record. That side of things is all working fine but is not really the issue. The problem is that if the record is already in the middle of a previous business process flow, I'm not able to switch it to the newly assigned one to use that as the active flow.

    The flow connects to the record without any issue, and if I click 'Switch Process' on the record I can see the new flow there as an in progress one to switch to, and if i choose it then it switches over fine and everything is set up correctly. In addition if the record does not have an existing business process flow already active against it, then it is also working fine and the new flow gets auto activated as its the only one.

    The specific issue is that once the business process flow is created and linked, how do you switch it to be the active process if one is already running against the record, as this doesn't happen automatically, where as the old depreciated "SetProcess" action does exactly this.

    Kind Regards

    Oliver

  • Wahaj Rashid Profile Picture
    Wahaj Rashid 11,321 on at
    RE: Switch Business Process via workflow (v9)

    Hi,

    Thank you for your query.

    Yes, you have to create a Business Process flow entity record.

    Are you setting the related record lookup in the BPF entity record? For example:

    pastedimage1612158441610v1.png

    Also, please look at the following:

    https://community.dynamics.com/crm/b/crminthefield/posts/automate-business-process-flow-stages-using-workflows

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans