Skip to main content
Microsoft Dynamics CRM forum
Unanswered

Navigate Business Process Flow - dependent on Current Tab

editSubscribe (0) ShareShare
ReportReport
Posted on by 15
Hello I when I select a tab on my form, I want it to coordinate with the business process flow.  The JavaScript below does not seem to work when navigating forward (selecting a tab ahead), but when I navigate backwards a step or two then the business process flow moves with it.  Any reason why I can't navigate forward?  None of the fields are set to required/are all filled out.  I want to be able to navigate back and forth between tabs and have the business process flow move with it.
 
function synchronizeTabAndBPF(executionContext) {
    var formContext = executionContext.getFormContext();
    var activeTab = getActiveTabName();
    // Switch business process flow based on active tab
    switch (activeTab) {
        case /tab_1/:
            formContext.data.process.setActiveProcess(/BPF1/);
            break;
        case /tab_2/:
            formContext.data.process.setActiveProcess(/BPF2/);
            break;
        // Add cases for other tabs and corresponding BPFs
        default:
            break;
    }
}

 
Thanks for any help!
Categories:
Attachments
  • Community member Profile Picture
    Community member 15 on at
    Navigate Business Process Flow - dependent on Current Tab
    Hello, I tried the bottom suggestion and it resulted the same.
    @Leah Ju
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Navigate Business Process Flow - dependent on Current Tab
    Hi Partner,
    If you want to execute function when tab change, you need consider using addTabStateChange() function.
    --This event occurs when the DisplayState of the tab changes due to user interaction or when the setDisplayState method is applied in code.
    Maybe you can refer to the following blog for more details:

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,183 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,733 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans