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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / POWER FX - Change curr...
Power Apps
Unanswered

POWER FX - Change current status record with command bar

(0) ShareShare
ReportReport
Posted on by 6

Hello,

 

I need helps 😉

From a modern driven application, I create new button in the salesorder command bar to change change statecode and statuscode of the active record.

With standard statecode and statuscode, it works well.

I have issue to use custom statuscode value as I can't retriev them in the formula :

 

Patch(Salesorder;Self.Selected.Item;statecode: 'statecode(Salesorders)'.'Active';'statuscode':'statuscode (Salesorders)'.'NEW'}
I can't find the new value "NEW" of statuscode.
 
thanks
I have the same question (0)
  • AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @FranckB44  is the statuscode (Salesorders)' a Standard or Custom Choice Column?

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • AlexisMichon Profile Picture
    6 on at

    It's a new value in the standard statuscode column

  • AlexisMichon Profile Picture
    6 on at

     

    From the formula area in the command bar, the value is not find

    Patch(Commandes;Self.Selected.Item; Statut: 'Statut (Commandes)'.'Exécuté(e)';'Raison du statut': 'Raison du statut (Commandes)'.Transmise})
    FranckB44_0-1662733727714.png

     

    But if I open the composent library, my new values are proposed. I don't undertsand
    FranckB44_1-1662733818065.png

     

     
  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @FranckB44, You can't add a Choice value to a standard statuscode column. This is a System Column that only hold Active or Inactive Values. 

     

    AhmedSalih_0-1662734360642.png

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @FranckB44, a side note, you can edit the Status reason though: Follow this post for how you can do that if you wish to go that route: https://powerusers.microsoft.com/t5/Microsoft-Dataverse/How-to-edit-the-status-reason-statuscode-option-list/td-p/596054

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • AlexisMichon Profile Picture
    6 on at

    It's not the same stauts as account. In salesorder, you can easily add customer values in statuscode see below.

    My conern is how to use new value from a button in my command bar

     

    FranckB44_0-1662734773104.png

     

  • OSP Profile Picture
    5 on at

    Same problem here, new custom "Status reason", not shown on command bar editor...

    We have edited and Pusblished the Component Library and now Command editor recognices the new status O.o

  • deseye Profile Picture
    48 on at

    To solve this, 

     

    while in the Command bar configuration page, there is “Open component library” at the top right. Click on that and it will launch the Component as a Canvas App studio. Refresh the datasource. You will be able to edit the Power Fx code correctly and publish.

    exit and return to the Command bar configuration and it will be good.

     

    the problem was, when you add a new column or modify column in Command bar configuration page, it does not automatically refresh the DataSource it references, so you have to manually refresh or add new Table if you want to work with related Tables .

     

    I 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

Last 30 days Overall leaderboard