Hello Everyone,
Scenario:
Optionset contains following values:
1. Baseball
2. Basketball
Subgrid records should be:
if baseball is selected , display records from "XYZ" entity where "field1"=accountid or field2=accountid and
if "Basket ball" is select, display records from "XYZ" entity where field1=accountid.
I need to use custom fetchxml in subgrid. So I thought of creating a PCF dataset control.
I searched in so many places but i cannot find a way or example to map the fetchxml result to dataset columns. I can add columns to the dataset but how do i assign a value to dataset columns that i get from the result of FetchXML.
Is it possible to do so?
I am new to PCF control and would really appreciate help.
Best Regards
Hi @sabin-sh ,
Maybe is a little late for you, but might still help for the future: with a dataset PCF you can take the view that was set by the customizer, and add some more filter. You don't need to hardcode a fetchXml.
Maybe my blog about dataset PCF might help: seamless integration , extensibility (here is an example of filter on top of the defined view), and multiple datatsets .
Best regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
I created a custom subgrid(not dataset) using PCF and use fetchxml as I could not find a way to inject fetchxml in dataset. I needed a dynamic query so I built one.
Hi @sabin-sh,
SetParameter was still unsupported in classic, although that worked. If you can get away with the 2nd filter on agencyname, then you can configure 2 views (one per client type) and then on load or on change of the client type change the view with setCurrentView function:
Cheers
@DianaBirkelbach you’re right they’re for lookups, not for subgrids!
HI @sabin-sh ,
My first approach would be, not to use an own fetchXml, but to make use of the filter method on the provided dataset: https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/dataset#filtering. But I have to admit that I haven't tried it out yet. Maybe somebody else might know more about this.
In case the filter approach doesn't work, I wouldn't make a dataset PCF, since then you actually don't use the dataset features. Then I would even try to use a field type pcf: bound to the optionset property that you have the dependency on. The rest you have to implement on your own anyway (except the Commandbar, ViewSelector and QuickFindSearch that you could activate only for a dataset pcf, but you can use them only if you don't use your own fetchXML)
@EricRegnier The addCustomView and addCustomFilter are only Lookup methods. I am pretty sure they are unsupported for a subgrid control. If you used them a lot, I would like to know is you had trouble in the last years using them. I think there was a change in CRM 2013, but did you had any trouble using them after that?
Best regards,
Diana
Hi @sabin-sh,
You don't necessarily need a PCF control for this. You can use the out-of-the-box subgrid with addCustomFilter or addCustomView (if you want dynamic columns) functions from the client API:
WarrenBelz
89
Most Valuable Professional
Michael E. Gernaey
72
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1