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.
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.
Was this reply helpful?YesNo
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.