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 / PowerFx command button...
Power Apps
Unanswered

PowerFx command button on subgrid doesn't create new record

(0) ShareShare
ReportReport
Posted on by 17
 
 
HI everyone-
 
I am attempting to build a PowerFx command button when items are selected on a subgrid:
 
 
My code in the button is to just change the status of each item selected, change a field on the main Job record and then put a notification at the top of the screen:
 
Patch(
    'Job Items',
    ForAll(Self.Selected.AllItems,
        {
            'Job Item': ThisRecord.'Job Item',
            Status: 'Status (Job Items)'.Active,
            'Status Reason': 'Status Reason (Job Items)'.'Out for Delivery'
        }
    )
);
Patch(Jobs, Self.Selected.Item.Job,
    {
        'Items Marked for Delivery?': 'Items Marked for Delivery? (Jobs)'.Yes
    }
);
Notify("Delivery created!");
 
The only thing that runs is the notification. The rest of the code is being ignored or just not running? The command buttons are pretty new to me so any assistance is really appreciated about what I'm doing wrong here.
 
Thank you.
Joe
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Not sure that Patch - For All works
    Try using For All -then Patch each individual record
    Try using Monitor to see what is happening with the updates


    I am not understanding where you are executing this code as Self normally refers to the control where the code is being executed. I would try an absolute reference to the control containing the data.

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard