web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Switching of forms changes the Business process flow of the form.

(0) ShareShare
ReportReport
Posted on by 105

There are 2 forms F1 and F2 which has two Business process flows P1 and P2 respectively. I am facing an issue as a an system administrator , That whenever i switch between forms then business process also switches but when i try to switch back to my original form , the business process does not switch .

Suppose if the existing record is in opened from Form F1 and i switched it to form F2 , the business process P1 gets switched to P2. But when i switch back again to Form F1, the P2 does not switch back to P1 and the form get switched.

Can anyone guide me with this issue?

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Rits

    By default, the same one BPF will applied for all forms of the entity.

    Have you done customizations to it, which make it switch process based on different forms?

    In general, you can use javascripts to switch Business Process Flow automatically based on current form.

    As you mentioned, “But when i switch back again to Form F1, the P2 does not switch back to P1 and the form get switched.

    So you can add following js code as web resource to the form F1 to switch BPF to P1 automatixally:

    function switchBPF(executioncontext) {
    
        var formContext = executionContext.getFormContext();
        formName = formContext.ui.formSelector.getCurrentItem().getLabel();
        if (formName == 'F1') {
            formContext.data.process.setActiveProcess("GUID of P1", callbackFunction); // 
        }
         function callbackFunction() {
            }
    }

    For example:

    The case form show 'Phone to Case Process' BPF by default, but i want to show 'Case to Work Order Business Process' when load case form.

    pastedimage1627956731045v1.png

    Js code:

    function switchBPF(executionContext) {
    
        var formContext = executionContext.getFormContext();
        formName = formContext.ui.formSelector.getCurrentItem().getLabel();
        if (formName == 'Case') {
            formContext.data.process.setActiveProcess("989E9B18-57E2-4AF1-8787-D5143B67523B", callbackFunction); // Case to Work Order Business Process
        }
        function callbackFunction() {
            }
    }

    Go to Customizations > Customize the system > Web Resource to create new.

    pastedimage1627957039126v4.png

    The Expand Entities to find case and open the form you need to add the web resource you just created.

    pastedimage1627956965840v3.png

    pastedimage1627956947576v2.png

    Test Result:

    pastedimage1627957187104v5.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Community Member Profile Picture
    on at

    Hi Partner,

    Please click Yes under "Did this answer your question?" to close this thread if the answer is helpful.

     pastedimage1628233915326v1.png

    Thanks. 

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Rits Profile Picture
    105 on at

    Sorry for late reply. This post was really very helpful and guided me . Thank you.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans