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 :
Microsoft Dynamics CRM (Archived)

First stage Business Process Flow

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I would like to customize the first stage of a Business process Flow based on a field value (This field is already filled before the process). In one case, I would like to display a required step (/field). In the other case I would like to hide it and set the step as not required. I need to do it in one process (due to the limit of 10 Business process per Entity). Do you have any idea?

Should I write a javascript which disabled and hide my field? Are there other ways?

Thanks a lot,

Léo

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Akanksha Ranjan Profile Picture
    460 on at

    Hi Leo,

    You can achieve this by using Enhanced Business Process Flow with Conditional Branching.

    Please refer the link below.

    https://technet.microsoft.com/library/mt826751.aspx

     

    Thanks

    P.S: Please mark the answer verified if found helpful. [View:https://technet.microsoft.com/library/mt826751.aspx:750:50]

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Leo ,

    Akanksha is correct you need to implement conditional branching in OOB business process flow while creation.

    Now next thing to make mandatory ,in that case you need to write the code like below -

    function OnLoadForm() {
        Xrm.Page.data.process.addOnStageChange(checkSelectedStage);
    }
    function checkSelectedStage() {
        var stageName = Xrm.Page.data.process.getSelectedStage().getName().toString().toLowerCase();
        var stageID = Xrm.Page.data.process.getSelectedStage().getId().toString().toLowerCase(); 
        if (stageName == "ConditionalStageName") { // You can also write  condition with stage id
            if (Xrm.Page.ui.controls.get("header_process_DependentFieldName") != null) {
                if (Xrm.Page.getAttribute("header_process_DependentFieldName").getValue() == "SomeValue") {
                    //Make Field Business Required 
                    if (Xrm.Page.ui.controls.get("header_process_FieldNameStepMandatory") != null) {
                        Xrm.Page.getAttribute("header_process_FieldNameStepMandatory").setRequiredLevel("required");
                    }
                }
                else {
                    //Make Field not business required 
                    if (Xrm.Page.ui.controls.get("header_process_FieldNameStepMandatory") != null) {
                        Xrm.Page.getAttribute("header_process_FieldNameStepMandatory").setRequiredLevel("none");
                    }
                }
            }
        }
    }


  • Community Member Profile Picture
    on at

    Hi Akanksha,

    Thanks a lot for your answer, I use CRM Dynamics 365 and the stage I would like to customize is the first stage. Unfortunately I can't put a condition before the first stage. (On this example the red lined stage: Qualify)

    2018_2D00_05_2D00_28-19_5F00_34_5F00_08_2D00_Enhance-business-process-flows-with-branching.png

    Thanks.

    Léo

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Leo,

    Its by design you have to start the business process flow first stage as default and based on that  you can add condition in the next stages and respectively. As an alternate I would suggest to make your first stage filed read only and non mandatory, I don't think there is any other alternate way to add condition on your first stage to make it hide .

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans