Hi All,
I'm trying to implement a custom button on a model driven app that will update the Status & Status Reason.
In the entity I've updated the Status Reason choice to have custom values:
Now, when I try to implement the solution described in https://jukkaniiranen.com/2021/10/reopen-tasks-with-power-fx-custom-command-bar-button/ I get an error.
Code that I'm using:
Patch(EntityName, Self.Selected.Item, {statuscode: 'Status Reason (EntityName)'.'Pending Team Review' ,statecode:'Status (EntityName)'.Active});
The above will work if I use "Active"/"Inactive" for the Status Reason:
Patch(EntityName, Self.Selected.Item, {statuscode: 'Status Reason (EntityName)'.Active ,statecode:'Status (EntityName)'.Active});
How can I access & set the custom Status Reason values?
Found a solution thru JS - executing an update action thru Client API (as described here https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference) got the required result.
Also pro tip - opening the command buttons in the component library and editing the formula there will sometimes give you access to properties, that are not displayed in the IntelliSense of the default command editor.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 2