Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

fireOnChange() not triggering pcf update view

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I'm not 100% sure of this even working but I believe it should.

 

A dynamics 365 pcf on a form has as input an optionset. This said optionset is set to never submit value on save (setSubmitNever) but still gets modified and needs to pass changed value to the pcf but this does not happen if the value doesn't get saved. Is that the correct behaviour? Shouldn't fireOnChange() still trigger the pcf? Afaik this worked for quite some time and we've lately discovered that it's not the case anymore and fireOnChange() doesn't trigger any pcf update.

 

Thanks in advance and best regards,

David

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: fireOnChange() not triggering pcf update view

    Hi @Anonymous , 

     

    To track the changes of a BPF, you could use a second bound property in your PCF; set a different value for this dummy property each time you want your updateView PCF method to get triggered.

     

    This property could be something you change anyway when the BPF stage changes: like a dummy optionset  on the form, reflecting the stage.

    Or just take a date as a second parameter and set it to the current datetime each time the BPF changes. You can use form scripting, and attach to the process stage changed event, and set there the datetime value to your dummy field.

     

    Hope this helps!

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: fireOnChange() not triggering pcf update view

    @Anonymous did these posts help solve your issue? If so, please mark a solution so future readers can see.

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: fireOnChange() not triggering pcf update view

    The BPF is also tracked as a related entity. Changes to your BPF stage should immediately be reflected in the related records there. Build your PCF on a dataset template and then attach it to a subgrid showing those.

  • Community Power Platform Member Profile Picture
    on at
    Re: fireOnChange() not triggering pcf update view

    Thanks for your reply.

     


    @skoofy5 wrote:

    So you've got formContext.getAttribute(pcf).setSubmitMode('never') on an optionset with a bound PCF and you're using formContext.getAttribute(pcf).fireOnChange() to try and trigger a re-render of the value?

    Not quite. setSubmitMode 'never' is set for the optionset bound to the pcf as input. The fireOnChange is called for the optionset when it has programatically been changed. So formContext.getAttribute(optionsetAttr).setSubmitMode('never') and formContext.getAttribute(optionsetAttr).fireOnChange(). But setting a new value for the optionsetAttr and calling fireOnChange() doesn't update the property bag of the pcf.

    I found the same question on github and ms says it's by design that the pcf doesn't update when fireOnChange() is called regardless if setSubmitMode set.

    How then would you track bpf phase changes in a pcf to show different data based on the selected phase?

  • skoofy5 Profile Picture
    480 on at
    Re: fireOnChange() not triggering pcf update view

    So you've got formContext.getAttribute(pcf).setSubmitMode('never') on an optionset with a bound PCF and you're using formContext.getAttribute(pcf).fireOnChange() to try and trigger a re-render of the value?

    The doc kind of implies it's also blocked for editing, but you're right, I don't know if that's always been the case - https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/attributes/setsubmitmode

    "The data is never sent with a save. When this value is used, the column(s) in the form for this column cannot be edited."

    I suppose to check if it's the submit mode causing the issue you could test without changing the submit mode?

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 76 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard