Hello everyone,
I am currently trying to change the status and status reason of a data record with a custom command bar button via Power Fx. Changing the status works without problems. However, I cannot change status reason.
Below is my non-working code. Note: I'm German, so I have to use a semicolon instead of a comma and a double semicolon instead of a semicolon (https://docs.microsoft.com/en-us/power-platform/power-fx/expression-grammar#separators).
Patch(
TableName;
Self.Selected.Item;
{
Statusgrund: 'Statusgrund (TableName)'.'Lable of the status reason';
Status: 'Status (TableName)'.Inaktiv
}
);;
After typing Statusgrund: 'Statusgrund (TableName)'. entered, the code completion suggests only the two options Aktiv and Inaktiv. Which leads to the default value of the respective status. Can someone explain me how to use the status reason here? I have already tried to use the value (number) of the status reason: Statusgrund: 'Statusgrund (TableName)'.'4'. I also tried to use the shed and attach the reason: Statusgrund: 'Statusgrund (TableName)'.Inaktiv.'Lable of the status reason'.
Thank you and best regards
Nico