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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Change case status based on BPF process step

(0) ShareShare
ReportReport
Posted on by 10

I would like for the case subject to automatically change from “Not Started” to “In Progress” once I have completed the first Business Process Flow stage of a case.

pastedimage1605701674010v1.png

Case status automatically change to In progress when 1st BPF is completed 

pastedimage1605701752510v2.png

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

    Hi Chandu,

    You can use javascript to change case status based on BPF process step.

    Here are steps.

    1.Js code.

    function formonload()
    {
    Xrm.Page.data.process.addOnStageChange(changeStatus); // Trigger the function when move to next stage.
    changeStatus();
    }
    
    function changeStatus()
    {
    var activeStage = Xrm.Page.data.process.getActiveStage();
    var stageId = activeStage.getId();
    var stagename = activeStage.getName();
    if (stagename == "Research") //stage2 name
    {
        Xrm.Page.getAttribute("statuscode").setValue(1);//In Progress
    }
    }

    2.Add js to web resource.

    Go Settings > Customization > Customize the System > Web Resources.

    pastedimage1605754387856v3.png

    3.Add js to OnLoad event of the case form.

    (1) Go Settings > Customization > Customize the System > Entities > Case > Form.

    Open the main form and click ‘Form Porperties’.

    pastedimage1605754380813v2.png

    (2) In ‘Form Porperties’ dialog.

     pastedimage1605754372719v1.png

    (3) Save and publish all customizations.

    4.Test.

    (1) BPF stage1:

     pastedimage1605754457530v4.png

    (2) BPF stage2:

    pastedimage1605754494964v5.png

    Regards,

    Leah Ju

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

  • Chandu Reddy Profile Picture
    10 on at

    Thank you Leah Ju.

    We have 6 BPF and stage 2 is different for each BPF. Can this also achieve via workflow rules using field update option?

  • Suggested answer
    Mahone Profile Picture
    64 on at

    You can do this with a workflow created on the BPF entity.  When the active stage changes, update the related case.  Use the conditions to do the mapping from the BPF stage to the Case Status reason.

    Screenshot-2020_2D00_11_2D00_19-104434.png

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Chandu,

    You just modify condition in js code:

    Original condition:

    if (stagename == "Research") //stage2 name

    Modified condition:

    if (stagename == "Research" || stagename == "name2" || stagename == "name3" || stagename == "name4" || stagename == "name5" || stagename == "name6")  //stage2 name for different BPF

    Regards,

    Leah Ju

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

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Partner,

    Has the problem been solved? Any updates?

    Please click Yes under "Did this answer your question?" to close this thread.

    pastedimage1605866376879v1.png

    Thanks. 

    Regards,

    Leah Ju

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
NeerajPawar Profile Picture

NeerajPawar 31

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 19 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 16

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans