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)

Dynamics 365 v9.0: How to trigger JS on change of fields added in the BPF

(0) ShareShare
ReportReport
Posted on by 50

Dynamics 365 v9.0: How to trigger JS on change of fields added in the BPF.

Is there any XRM objects or commands that we can use to trigger on change of the fields in the specific stages of BPF.

Any help on this would be great.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Madhu ,

    Try with this  -

    function OnloadForm() { // Register the function in Onload event
        Xrm.Page.data.process.addOnStageSelected(OnStageSelected);  
    }
    
    function OnStageSelected() {
        if (Xrm.Page.getControl("header_process_FieldName") != null) { // Replace Field Name
            Xrm.Page.getControl("header_process_FieldName").getAttribute().addOnChange(CallOnChangeFunction); //Replace Field Name 
        }
    }
    function CallOnChangeFunction()
    {
    // Write your onchange logic here 
    }


    For me , its better to add the field onchange event in the form field itself , you can make display none in form field and make it visible in the BPF. 

    Hope this helps.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Madhu,

    If you have a the onchange on the form field then that ill trigger on the BPF as well. You do no need to do anything special for BPF fields.

    Thanks,

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    simple put the field on the form and hide it, register the event in the field.

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