Announcements
Have a PCF grid that replaces native main view. I need to mimic the OnRowSelect event handler of the native grid to set the SelectedRow so that the command bar will recognize that there is a record selected. In this case - mainly trying to get the Email a Link to work which needs to see a row is selected. Anyone have any luck with this?I looked at articles like this (https://community.dynamics.com/forums/thread/details/?threadid=fb6c85ea-10b3-4a87-92ed-e9135aaaa8c5) but not seeing a way on the main view to set the Selected Row. Thanks!
It's easier than you think. Just use:
this.context.parameters.<your dataset name>.setSelectedRecordIds(ids)
where "ids" is a string[] of the selected row guids
Thank you so much. That works in terms of setting it - but not changing the command bar context as I would have expected.... Still unable to click Email a Link as says no records selected. Any thoughts? Thanks.
Hi @shadowfox ,
The solution from @cchannon should work, as long your dataset is the first one in your manifest.
For the second it wouldn't work.
By calling this, the updateView will be called for you again.
Maybe you could log the context.parameters.yourDataset.getSelectedRecordIds() in updateView, to check of the setting is working.Also, maybe you can check that your command is enabled by using another dataset control (maybe using the "show As" and switch to the standard Power Apps Grid )
Thanks everyone - that did work, we found out that the issue and it was a silly problem. Once we figured that out - all was good!
Follow-up question: I see that Microsoft changes datasets where before you use to get back total number of records using dataSet.paging.totalResultCount. And I was able to process quite a bit of data. Now though if it's over 10,000 records, you get a -1 for totalResultCount and the paging to load next page is incredibility slow. Anyone come across this and/or have a solution? Thanks!
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 547
WarrenBelz 444 Most Valuable Professional
Valantis 322