Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics 365/CRM Form JavaScript Business Process Flow Issue

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am running into an issue when setting a business process flow field to be required conditionally with JavaScript. I can successfully set the red asterisk on the client side next to the business process flow field in the stage, however, when the "Next Stage" button is clicked, this hidden system function on the button click is not checking client side validation for these required fields, and allows the user to proceed to the next stage without throwing an error. Has anyone else had this same issue, and what have you done to overcome it?

Some questions you may have: I have multiple Yes/No fields in the first stage, and pending the selection of any of these fields as "Yes," I want to require that the user need to click a corresponding Yes/No completed field at a stage later in the process. So, while I could make multiple branches to handle field requirement in the business process flow, it gets messy very quickly by adding tons of "possible" paths. I should be able to conditionally set requirement of a field in the process, and there should be client side validation when the user attempts to proceed to the next step.

Is there something I'm missing?

Thanks!

sample code of how I'm setting field requirement in BPF header:

function setRequiredFields() {

    var myField = Xrm.Page.getAttribute("bit_myfield").getValue();
    var bpfControl = Xrm.Page.getControl("header_process_bit_laboradded").getAttribute();

    if (needLabor === true) {

        bpfControl.setRequiredLevel("required");

    } else {

        bpfControl.setRequiredLevel("none");

    }
}


 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics 365/CRM Form JavaScript Business Process Flow Issue

    Hi @Andreas Cieslik - thanks for the response. I checked through that post already and it does not answer my questions. Additionally, I have a BPF that spans across more than one entity which means I only have access to form fields of the current entity that is shown. Regardless of all of this, it still seems like a bug in the function that is called internally when the Next Stage button is clicked. If a business process field has been marked required through javaScript, this internal function should be checking for that and stopping the moveNext() function from happening. I'm posting because I believe I have found a bug.

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: Dynamics 365/CRM Form JavaScript Business Process Flow Issue

    This thread might give you the answer:

    community.dynamics.com/.../170994

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans