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
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!
@Anonymous did these posts help solve your issue? If so, please mark a solution so future readers can see.
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.
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?
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?
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
76
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1