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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / fireOnChange() not tri...
Power Apps
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

I have the same question (0)
  • skoofy5 Profile Picture
    482 on at

    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?

  • Community Power Platform Member Profile Picture
    on at

    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?

  • cchannon Profile Picture
    4,702 Moderator on at

    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.

  • cchannon Profile Picture
    4,702 Moderator on at

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

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard